知识库
Web开发技术
xlsstr = ""
execlfile = server.mappath(xlsfilename)
set objexcelapp = createobject("excel.application")
objexcelapp.quit
set objexcelapp = createobject("excel.application")
objexcelapp.quit
objexcelapp.displayalerts = false ’不显示警告
objexcelapp.application.visible = false ’不显示界面
objexcelapp.workbooks.open(execlfile)
set objexcelbook = objexcelapp.activeworkbook
redim arrsheets(objexcelbook.sheets.count)
for i=1 to objexcelbook.sheets.count
arrsheets(i) = objexcelbook.sheets(i).name
next
objexcelapp.quit
set objexeclapp=nothing
’##################################
’##################################
set excelconn = server.createobject("adodb.connection")
exceldriver = "driver={microsoft excel driver (*.xls)};dbq=" & execlfile
excelconn.open exceldriver
set rs = server.createobject("adodb.recordset")
for i = 1 to ubound(arrsheets)
sql = "select * from ["& arrsheets(i) &"$] "
’’显示各工作表的名称
’’xlsstr = xlsstr & "
"& arrsheets(i) &"
"
xlsstr = xlsstr & "