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

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".
ghsnehashisAsked:
Who is Participating?
 
jcimarronConnect With a Mentor Commented:
0
 
ghsnehashisAuthor Commented:
Thanks for your reply. I will check and update.
0
 
ghsnehashisAuthor Commented:
Thanks jcimarron.

Thanks for your help.

It's a great solution. Every one needs to know this solution.
0
 
jcimarronCommented:
ghsnehashis--You are most welcome!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.