写一段CADVBA代码,CAD读取excel文件中的数据
时间: 2023-03-15 11:09:49 浏览: 106
Sub CAD_Read_Excel_Data()Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.WorksheetSet xlApp = New Excel.Application
Set xlBook = xlApp.Workbooks.Open("C:\Path\To\ExcelFile.xlsx")
Set xlSheet = xlBook.Worksheets("Sheet1")Dim i As IntegerFor i = 1 To xlSheet.UsedRange.Rows.Count
Debug.Print xlSheet.Cells(i, 1)
Next ixlBook.Close
xlApp.QuitEnd Sub
阅读全文