Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Run Time Error 4198 Using ActiveDocument.Close with Word2000

91 views
Skip to first unread message

Mark Whitmire

unread,
Jul 17, 2002, 8:25:18 AM7/17/02
to
I have VBA code that has lived through all the versions of
Word until Word2000. In Word2000 the command
ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges
causes error 4198 the first time it is encountered. If I
choose debug from the error dialog box and then hit the
run button from the visual basic editor, it runs the
command without error and it nevers errors on that line
again. If I use a break point to stop the code before the
ActiveDocument.Close statement and run it a line at a
time, it does not error out. It only errors at full speed
and only the first time. This happens on any Word2000 PC
I run the code on.

What I'm doing is creating a large document that is made
up of small files that the user selects from a dialog
box. Some of the smaller files need to be manipulated
before thay can be inserted into the main document, so I
open them, manipulate them, copy the text, and then close
the smaller document without saving the changes. I
simplified the code so that all it does is open the doc
and close the doc and I still get the error the first time
it's ran. I've tried all kinds of error handlers to no
avail. I've tried moving the offending code to different
procedures, etc., and nothing works. Can some one out
there help me?!

Cindy Meister -WordMVP-

unread,
Jul 19, 2002, 5:05:22 AM7/19/02
to
Hi Mark,

I'd guess we're looking at some damage in the document.
Especially if it's wandered through file conversion a time or
two. I'd try:

1) Copy all the text EXCEPT the last paragraph mark to a new
document. (If the template doesn't contain any text, just
create a new document)

2) In the VB Editor, use File/Export to send all the macro
modules to pure text (*.bas) files.

3) Use File/Import to bring the macros into the new document.

4) Reset any references in Tools/References

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://www.mvps.org/word
http://go.compuserve.com/MSOfficeForum

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

0 new messages