Attempted to read or write protected memory. This is often an indication that other memory is corrupt

Posted on 2011-09-14
Last Modified: 2013-12-17
Code :

Microsoft.Office.Interop.Excel.Workbook excelWorkbook = excelApp.Workbooks.Open(workbookPath,
                        0, false, 5, "", "", false, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "",
                        true, false, 0, true, false, false);

When trying to open excel it is throwing an error "Attempted to read or write protected memory. This is often an indication that other memory is corrupt".
Question by:ghsnehashis
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
LVL 50

Accepted Solution

jcimarron earned 500 total points
ID: 36538981

Author Comment

ID: 36540662
Thanks for your reply. I will check and update.

Author Closing Comment

ID: 36541625
Thanks jcimarron.

Thanks for your help.

It's a great solution. Every one needs to know this solution.
LVL 50

Expert Comment

ID: 36544074
ghsnehashis--You are most welcome!!

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This collection of functions covers all the normal rounding methods of just about any numeric value.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Viewers will learn the different options available in the Backstage view in Excel 2013.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question