Reputation: 31
Here is the code:
try
{
if (File.Exists("c:\\Reports\\" + fileName))
{
File.Delete("c:\\Reports\\" + fileName);
}
_book.SaveAs("c:\\Reports\\" + fileName, Excel.XlFileFormat.xlWorkbookNormal,
null, null, false, false, Excel.XlSaveAsAccessMode.xlShared,
false, false, null, null, null);
}
catch (Exception ee)
{
throw ee;
}
On saving to excel format . I have got the following error as follows..
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
I am using MS Office version 2000.
Dll using is Interop.excel 1.4.0.0
Using Visual studio 2008 + c# console application
Upvotes: 2
Views: 687