Solved

Protected Memory Error When Using Automation to Control Excel

Posted on 2007-11-18
3
165 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
Comment Utility
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
Comment Utility
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
Comment Utility
Ok great...
Please close the Q if this helped...
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
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 …
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

763 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

7 Experts available now in Live!

Get 1:1 Help Now