我从网上找了一个代码,通过asp把excel数据倒入。程序可以执行,但是每次都很慢,而且每执行一次都打开一个excel进程,但是这个进程却关闭不掉。只有重新启动机器,excel进程才被关掉。请问如何才能解决这个问题。或者有没有更好的方法把excel倒入。谢谢 <%
Set xlApp = server.CreateObject("Excel.Application")
strsource = "e:\book1.xls"
Set xlbook = xlApp.Workbooks.Open(strsource) Set xlsheet = xlbook.Worksheets(1)
i=1 response.write "<table cellpadding=0 cellspacing=0 border=1 width=500>" while xlsheet.cells(i,1)<>""
response.write "<tr>" response.write " <td height=20 align=center width=70>" & xlsheet.Cells(i, 1) & "</td>" response.write " <td height=20 align=center width=140>" & xlsheet.Cells(i, 2) & "</td>" response.write " <td height=20 align=center width=210>" & xlsheet.Cells(i, 3) & "</td>" response.write " <td height=20 align=center width=280>" & xlsheet.Cells(i, 4) & "</td>" response.write " <td height=20 align=center width=350>" & xlsheet.Cells(i, 5) & "</td>"
response.write "</tr>" i=i+1
wend response.write "</table>" set xlsheet=nothing set xlbook=nothing xlApp.quit %>