Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL)) on Microsoft.Office.Interop.Excel.ChartObject.Copy
i am working with Microsoft.Office.In开发者_高级运维terop.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
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)
精彩评论