469,898 Members | 1,597 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,898 developers. It's quick & easy.

Attempted to read or write protected memory.....

Hi,

I'm using automation to produce word documents, and it's working fine in my
machine that have vs.net 2005 and office xp in it. BUT when I move my
application to another machine that have vs.net 2005 express edition with
office 97 I'm getting this error:
"Attempted to read or write protected memory. This is often an indication
that other memory is corrupt."

when it comes to the second line of this code :
wrdApp = new Word.Application();
// Add a new document.
wrdDoc = wrdApp.Documents.Add(ref oName, ref oFalse, ref oMissing, ref
Missing);
Do I have to upgrade the vs.net 2005 express edition to vs.net 2005 and
word97 to xp to make it work or is it some thing else!?

Cheers.

Apr 23 '07 #1
1 1595
Hi,

Firstly, there are differences in office that can cause this error. I did
have the same situation and upgraded office to fix it.

Secondly, office is not supported for automation from within an ASP.NET
application. Whilst my first point above, I did get it to work, I was having
serious problems with it, and ultimately changed my direction. I created a
class to do RTF files and used that instead. Never had a problem since, and
as RTF can be read by word immediately, it solved my problem.

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
"Badis" <Ba***@discussions.microsoft.comwrote in message
news:55**********************************@microsof t.com...
Hi,

I'm using automation to produce word documents, and it's working fine in
my
machine that have vs.net 2005 and office xp in it. BUT when I move my
application to another machine that have vs.net 2005 express edition with
office 97 I'm getting this error:
"Attempted to read or write protected memory. This is often an indication
that other memory is corrupt."

when it comes to the second line of this code :
wrdApp = new Word.Application();
// Add a new document.
wrdDoc = wrdApp.Documents.Add(ref oName, ref oFalse, ref oMissing, ref
Missing);
Do I have to upgrade the vs.net 2005 express edition to vs.net 2005 and
word97 to xp to make it work or is it some thing else!?

Cheers.

Apr 23 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.