Click here to Skip to main content
14,699,886 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am getting the following error while saving a workbook

Exception from HRESULT: 0x800A03EC

Code is as follows:
  string str_Path;
  str_Path = txtFile.Text;
  if (File.Exists(str_Path))
    string strFile = Path.GetFileName(str_Path);
    Excel.Application xlApp;
    Excel.Workbook xlWorkBook;
    Excel.Worksheet xlWorkSheet;
    xlApp = new Excel.ApplicationClass();
    xlApp.DefaultFilePath = str_Path;
    xlWorkBook = xlApp.Workbooks.Open(str_Path, 0, true, 5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);
    xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);
    xlWorkBook.SaveAs(strFile, Excel.XlFileFormat.xlDBF4, Type.Missing, Type.Missing, Type.Missing,
      Type.Missing, Excel.XlSaveAsAccessMode.xlNoChange, Type.Missing, Type.Missing, Type.Missing,
      Type.Missing, Type.Missing);
    MessageBox.Show("File converted successfully.File(dbf) in My Documents");
    MessageBox.Show("File Not exist");
  MessageBox.Show("Error in converting to dbf");

Can anyone give me solution or where i am doing wrong?
Updated 9-Jun-11 5:21am
Sandeep Mewara 9-Jun-11 10:57am
Anthing else other than : "Exception from HRESULT: 0x800A03EC "?
Also check eventviewer if you can gather more info.

See this thread:[^].

SA beat me it. BTW you should have mentioned full error message in your question. Anyway here you go for more solved links.

Exception from HRESULT: 0x800A03EC - Excel, .Net, SQL and Windows Server 2008[^]

Free attachment
Considerations for server-side Automation of Office[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900