'以下是程序,在窗体中建一下COMMAND1
Private Sub Command1_Click()
dim ii as string
dim x as integer
dim y as integer
Set oleExcel = CreateObject("Excel.Application")
oleExcel.Visible = True
oleExcel.Workbooks.Open FileName:="E:\数据.xls"
x=0
y=5
ii=oleExcel.Worksheets("Sheet1").Range("A1").Cells(y, x)
oleExcel.Save
oleExcel.displayalerts = False
oleExcel.Quit
End Sub
'另: 需要引用microsoft activex data objects 2.5 library
microsoft DAO 3.51 object library
要用VB编程调用EXCEL才能读取它里面数据