声明
Dim xlApp As Excel.Application 'excel控件专用声明
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
打开
Set xlApp = CreateObject("Excel.Application") '创建EXCEL对象
Set xlBook = xlApp.Workbooks.Open(App.Path & "\book1.xls") '打开已经存在的EXCEL工件簿文件
xlApp.Visible = False '设置EXCEL对象可见(或不可见)
Set xlSheet = xlBook.Worksheets(sheet1) '设置活动工作表
读取B3
变量 = xlSheet.Cells(3, 2) '或者是(2,3)我记不清楚了
关闭
xlBook.Close
xlApp.Quit '结束EXCEL对象
Set xlApp = Nothing '释放xlApp对象
可满意否???满意就给分吧~~~