I created a tool to convert Excel files. When the user convert a excel file the code create a Excel file first. When I'm on my system (Excel 2007) it's working without problems. When I install the program on a system with Excel 98 then it's throwing an exception. The first exception I got was another one, but also a HResult error. I fixed this through change the "SaveAs" to "SaveCopyAs". Then it was FIXED! Also for the other systems where Excel 98 is installed, but now I have another HResult error. What is the problem here:
_savePath = sfd.FileName;
MessageBox.Show("GOOD1");
Microsoft.Office.Interop.Excel.Application excelApp = new Microsoft.Office.Interop.Excel.Application();
MessageBox.Show("GOOD2");
// The exception is here on the workbook
// HResult 8x00010105 (COMException)
Microsoft.Office.Interop.Excel.Workbook workbook = excelApp.Workbooks.Add(Missing.Value);
MessageBox.Show("GOOD3");
workbook.SaveCopyAs(_savePath);
MessageBox.Show("GOOD4");
lblSavePath.Text = _savePath;
workbook.Close(false, _savePath, Type.Missing);
excelApp.Quit();
I hope someone could help me with this problem.
Thanks,
Jamie