Word Macro keeps crashing

P

Paul

I have written a word macro that basically merges three
seperate "rtf" reports into one document and then saves as
a word97 document.

I have tried to share it with several colleagues but on
one or two machines it keeps crashing at the save part
with the following error:

"winword.exe. The instruction a t"0X307a29c3" reference
memory at "0x000000020". The memory could not be read."

When you click "OK" Word closes. Any ideas anyone?

This is the body of the macro:

Selection.EndKey Unit:=wdStory
Selection.InsertBreak Type:=wdPageBreak

ChangeFileOpenDirectory "\\UKHBEUDATA05
\BERGMAN_P$\moodys risk advisor\" [THIS FOLDER IS
PERSONALISED FOR EACH DIFFERENT USER]
Selection.InsertFile FileName:="Financial
Assessments.rtf", Range:="", _
ConfirmConversions:=False, Link:=False,
Attachment:=False
Selection.TypeParagraph
Selection.InsertBreak Type:=wdPageBreak
Selection.InsertFile FileName:="Summary Key
Assessments.rtf", Range:="", _
ConfirmConversions:=False, Link:=False,
Attachment:=False
Selection.HomeKey Unit:=wdStory

Dim Message, Title, Default, MyValue
Message = "Enter file name for this document" ' Set
prompt.
Title = "File Name Request" ' Set title.
' Display message, title, and default value.
MyValue = InputBox(Message, Title, Default)


ChangeFileOpenDirectory _
"\\UKHBEUDATA05\BERGMAN_P$\moodys risk advisor\"
ActiveDocument.SaveAs FileName:=MyValue, FileFormat:= _
wdFormatDocument, LockComments:=False,
Password:="", AddToRecentFiles:= _
True, WritePassword:="",
ReadOnlyRecommended:=False, EmbedTrueTypeFonts:= _
False, SaveNativePictureFormat:=False,
SaveFormsData:=False, _
SaveAsAOCELetter:=False [THIS IS WHERE IT CRASHES]



Thanks.
 
C

Cindy Meister -WordMVP-

Hi Paul,
I have written a word macro that basically merges three
seperate "rtf" reports into one document and then saves as
a word97 document.

I have tried to share it with several colleagues but on
one or two machines it keeps crashing at the save part
with the following error:

"winword.exe. The instruction a t"0X307a29c3" reference
memory at "0x000000020". The memory could not be read."
Mmmm. No idea why, but perhaps we can help you track it down

1) If you go through the process "by hand", are you able to
successfully pull in the RTF files and save the document?
(IOW, we want to isolate this to machine vs. macro)

2) Is everyone using Word 97?

3) If you start Windows in Safe Mode, does the problem
persist?

4) If you start Word in safe mode, does it still crash? (Add
the /a switch to the "target" line in the Word icon's
properties)

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jan
24 2003)
http://www.mvps.org/word

This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top