当我在IIS中托管我的Dot-Net应用程序时,Excel文件不会打开

本文关键字:Excel 文件 应用程序 Dot-Net IIS 我的 管我 | 更新日期: 2023-09-27 17:52:57

我有我的Dot-Net应用程序,我通过点击按钮从DB获取路径来打开Excel文件,它工作得很好,但当我在IIS中托管我的应用程序时,我会得到以下异常-

 System.Runtime.InteropServices.COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC 
 at Excel.Workbooks.Open(String Filename, Object UpdateLinks, Object ReadOnly, 
                          Object Format, Object Password, Object WriteResPassword, 
                          Object IgnoreReadOnlyRecommended, Object Origin, 
                          Object Delimiter, Object Editable, Object Notify, 
                          Object Converter, Object AddToMru, Object Local, 
                          Object CorruptLoad)

请帮助。。。

当我在IIS中托管我的Dot-Net应用程序时,Excel文件不会打开

我通常发现这些是IIS中与网站相关联的用户的权限问题。请确保IIS用户有权访问该文件。

顺便说一句,我可能会考虑使用不需要使用Excel Automation的第三方DLL。如果你不需要XLSX的支持,我在NPOI方面取得了很好的成功。只是一个建议。

祝你好运。

是否模拟uSer referhttp://support.microsoft.com/kb/306158