1.VB 读åExcelçå
容
VB 读åExcelçå 容
'以ä¸æ¯æºä»£ç ï¼
'å¼ç¨Microsoft Excel .0 Object Library
'Excelæ件æ¾äºDçç®å½ä¸ï¼å称为ï¼my.xls
Private Sub Command1_Click()
Dim A() As String
Dim i As Integer
Dim xlsApp As Excel.Application
Dim xlsWorkbook As Excel.Workbook
Dim xlssheet As Excel.Worksheet
Set xlsApp = CreateObject("Excel.Application")
Set xlsWorkbook = xlsApp.Workbooks.Open("D:\my.xls")
xlsApp.Visible = True
xlsApp.Range("A1").Select
For i = 1 To
A(i) = xlsApp.ActiveCell.Offset(0, i - 1).Value
Print i;
Print " ";
Print A(i)
Next i
Set xlssheet = Nothing
Set xlsWorkbook = Nothing
Set xlsApp = Nothing
End Sub
2024-12-24 20:28
2024-12-24 19:52
2024-12-24 19:30
2024-12-24 19:24
2024-12-24 18:32
2024-12-24 18:23
2024-12-24 18:19
2024-12-24 18:02