Home » MS OfficeRSS

system.AccessViolationException when trying to open excel workbook

System.Exception: CriticalProgramError ---> System.Exception: CriticalProgramError ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack, Boolean IgnoreReturn)
   at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn)
 

2 Answers Found

 

Answer 1

Hi,

 

Have you found the issue yet ?

 

I got the same problem today.

 

All my developpements works fine on Windows 2000 or XP with any Excel from 2002 to 2007.

 

But when i deploy this application on a Windows XP with Office 2000, i've got this Exception.

 

I think it's because of the Excel API i use (2002) but i'm not sure.

 

Answer 2

Hi Sreenatha

The error message, alone, won't give us enough information to help you, I fear.

Could you show us the code involved that triggers the message, please? Not just the line with Workbooks.Open, but everything to do with instantiating the Excel application.

Also, have you checked that Workbooks.Open is causing the error, or could it be some other line of code?

Is your code running in some kind of loop?

What kind of project is this (WinForms, Console App, etc.)?

 
 
 

<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Follow us on Twitter