Exporting Excel to XML Spreadsheet or CSV File

M

Maqsood Ahmed

Hello,
I have created a .net Library in C# that provides funcationality for
Excel Interoprebility.
Now, whenever I want to "Save" Excel Spreadsheet as XML Spreadsheet it
raises an Exception: "Exception in HRESULT: 0x800A03EC".
Here is my code snippet:

***********************************************************
private static Excel.Application excelApp;
private Excel.Workbook workBook;
workBook = excelApp.Workbooks.Open(WorkbookPath,0,false,5,"","",false,Excel.XlPlatform.xlWindows,"",true,false,0,true,false,false);

// Do Something useful.

workBook.SaveAs(@"C:\abx.xml",Excel.XlFileFormat.xlXMLSpreadsheet,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Excel.XlSaveAsAccessMode.xlShared,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing);
************************************************************

Interesting fact here is, this same method call runs fine when I save
Excel Spreadsheet as another Excel Spreadsheet (I know about
SaveCopyAs(filename)).

Am I doing anything wrong, while exporting .xls file to .xml file?
I'll be wating for an early responce
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top