Private Sub Form_Load()
Dim S() As String, i As Integer, j As Integer
Dim cellxd() As Single
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
Set xlBook = xlApp.Workbooks.Open("c:\1.xls")'把它改成具体文件名称
Set xlSheet = xlBook.Worksheets("Sheet1")
ReDim cellxd(1 To 200)
For i = 1 To 200
cellxd(i) = xlSheet.Cells(i, 1)
Next
xlBook.Close (True)
xlApp.Quit
Set xlBook = Nothing
Set xlBook = Nothing
Set xlApp = Nothing '释放xlApp对象
MsgBox "已经把第1列的值赋给数组!", vbInformation, "提示"
Unload Me
End Sub
温馨提示:答案为网友推荐,仅供参考