Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 172
  • Last Modified:

Protected Memory Error When Using Automation to Control Excel

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
kiranboi
Asked:
kiranboi
  • 2
1 Solution
 
bsharathCommented:
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
 
kiranboiAuthor Commented:
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
 
bsharathCommented:
Ok great...
Please close the Q if this helped...
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now