Solved

Protected Memory Error When Using Automation to Control Excel

Posted on 2007-11-18
3
166 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

862 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

Need Help in Real-Time?

Connect with top rated Experts

30 Experts available now in Live!

Get 1:1 Help Now