Solved

Protected Memory Error When Using Automation to Control Excel

Posted on 2007-11-18
3
167 Views
Last Modified: 2010-04-23
Hi all,

I have written a little utility that prints out information in a certain format by using automation to insert the data into an Excel template and then print to the default printer from Excel.

This has all been working fine. I have now upgraded the utility slightly and now, even though I havn't changed the automation part, whenever my app tries to open an Excel file I get an error saying: I have attmepted to read or write protected memory. This then stops my app from working.

Does anyone know why this is happening and what I can do to fix it?

Many Thanks.
0
Comment
Question by:kiranboi
  • 2
3 Comments
 
LVL 11

Accepted Solution

by:
bsharath earned 500 total points
ID: 20307807
This error appears in many reasons..
As you say this happened after a code change.
See if this helps...
http://www.codeguru.com/forum/showthread.php?threadid=366165
0
 

Author Comment

by:kiranboi
ID: 20312604
Thanks for the advice but it turns out it was looking for Microsoft Excel 11.0 Object Library and couldnt find it on the target machine.
I found a previous question on EE telling me to change from early binding to late binding and it works great now.
Thanks
0
 
LVL 11

Expert Comment

by:bsharath
ID: 20312646
Ok great...
Please close the Q if this helped...
0

Featured Post

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Close form "before" open 3 41
SqlServer no dupes 25 35
Sql server insert 13 32
vb.net class 3 17
Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

832 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