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

2024年12月02日 19:04
有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