c# - Error while saving the workbook : System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x800A03EC -


i creating excel file asp.net application. hosting site on iis7.

when run server, giving error while saving workbook.

my code

workbook.saveas(server.mappath("folder") + "\\" + filename + ".xls" , excel.xlfileformat.xlhtml, objopt, objopt, false, false ,excel.xlsaveasaccessmode.xlshared, false, false, objopt, objopt); 

i have been trying solve week. hope ll find here

this error

system.runtime.interopservices.comexception: exception hresult: 0x800a03ec  

i using office 2000,iis7. have set authorizations. suggestions highly appreciated.

interop not supported in sever-scenarios (like iis) ms.

there many options read/edit/create excel files without interop/installing excel on server:

ms provides free openxml sdk v 2.0 - see http://msdn.microsoft.com/en-us/library/bb448854%28office.14%29.aspx (xlsx only)

this can read+write ms office files (including excel).

another free option see http://www.codeproject.com/kb/office/openxml.aspx (xlsx only)

if need more handling older excel versions (like xls, not xlsx), rendering, creating pdfs, formulas etc. there different free , commercial libraries closedxml (free, xlsx only), epplus (free, xlsx only), aspose.cells, spreadsheetgear, libxl , flexcel etc.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -