I'm opening an Excel file in .NET 4.0 (C#). I'm using the 12.0 version of interop. The Excel file is an xls (old). I can open it just fine, but workbook.close() causes a COM Exception with no real details around it.
oExcel = new Application();
oExcel.Visible = true;
oExcel.DisplayAlerts = false;
oBooks = oExcel.Workbooks;
oBook = null;
oBook = oBooks.Open(finalFilename);
oBook.Close(); // this gives COM Exception
Any ideas what I'm doing wrong?
Here is the interesting thing. I don't have to save this. After it does what it needs to do, I pull the data I need out and store it and the workbook I just made a copy of can just go away.