帮我看看,搞了半天也没搞定,累的兄弟满头汗
tix66 2003-05-27 05:56:43 我的编译目录有excel文件(文件名是excel.xls)
在程序中 执行
xlsheet.ActiveSheet.Export(Server.MapPath(".") + "\excel.xls", OWC.SheetExportActionEnum.ssExportActionNone)
就是把结果 输出到 excel.xls 中
可是总是出错:
“/excel”应用程序中的服务器错误。
--------------------------------------------------------------------------------
HRESULT 中的异常:0xE004002A。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.Runtime.InteropServices.COMException: HRESULT 中的异常:0xE004002A。
源错误:
行 57: reader.Close()
行 58: objConn.Close()
行 59: xlsheet.ActiveSheet.Export(Server.MapPath(".") + "\excel.xls", OWC.SheetExportActionEnum.ssExportActionNone)
行 60: End If
行 61: End Sub
源文件: C:\Inetpub\wwwroot\excel\WebForm1.aspx.vb 行: 59
堆栈跟踪:
[COMException (0xe004002a): HRESULT 中的异常:0xE004002A。]
OWC.Worksheet.Export(String FileName, SheetExportActionEnum ExportAction) +0
excel.WebForm1.Button1_Click(Object sender, EventArgs e) in C:\Inetpub\wwwroot\excel\WebForm1.aspx.vb:59
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1263