Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL)) on Microsoft.Office.Interop.Excel.ChartObject.Copy

拥有回忆 提交于 2019-12-11 11:53:44

问题


i am working with Microsoft.Office.Interop.Excel, to copy excel chart into power point using Asp.net. It works fine in visual stdio IDE but as i I deploy it on server. it gives an error , Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))

this erorr generted by code when it copies the charobject ,Only data copies perfectly fine.

problem is with chartobject.copy() function. I googled alot but it gives nothing please help me.

Moazzam


回答1:


Office interop is NOT supported by MS in server-side scenarios (like ASP.NET or Windows Service) - see http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757#kb2

For server-side handling of Excel files you will need to use some 3rd-party library - there are several free and commercial libraries available:

  • MS provides the OpenXML SDK V 2.0 (free)
  • http://www.codeproject.com/KB/office/OpenXML.aspx (free)
  • ClosedXML (free)
  • EPPlus (free)
  • Aspose.Cells (commercial)
  • SpreadsheetGear (commercial)
  • LibXL (commercial)
  • Flexcel (commercial)


来源:https://stackoverflow.com/questions/4344598/unspecified-error-exception-from-hresult-0x80004005-e-fail-on-microsoft-off

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!