VB中的变量怎样获取excel中单元格的值

2024-12-02 19:04:02
推荐回答(1个)
回答1:

set objExcelApp = CreateObject("Excel.Application")
objExcelApp.DisplayAlerts = false    不显示警告
objExcelApp.Application.Visible = false    不显示界面

strAddr = Server.MapPath(".")
objExcelApp.WorkBooks.Open(strAddr & "\1111.xls")
set objExcelBook = objExcelApp.ActiveWorkBook
set objExcelSheets = objExcelBook.Worksheets
set objExcelSheet = objExcelBook.Sheets(1)

aa=objExcelSheet.Cells(1,1).Value