我使用以下代码在经典asp中创建了一个excel文件。
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = TRUE
objExcel.Workbooks.Add
Set objWorksheet = objExcel.Worksheets("Sheet2")
objWorksheet.Activate
objWorksheet.Cells(1, 1).Value = "A"
我遇到以下错误。
Microsoft Office Excel (0x800A03EC)
Microsoft Office Excel cannot open or save any more documents because there is not enough available memory or disk space. • To make more memory available, close workbooks or programs you no longer need. • To free disk space, delete files you no longer need from the disk you are saving to.
我该如何解决这个问题?感谢。
答案 0 :(得分:3)
我没有创建一个Excel实例来创建文件(我总是发现泄漏内存并最终从Classic ASP失败的方法),我建议你考虑将数据输出为一个大的HTML表,然后强制浏览器在您的响应开始时使用以下内容在Excel中打开它:
<%
response.ContentType = "application/vnd.ms-excel"
response.AppendHeader "content-disposition", " filename=export.xls"
%>