Word 2003 - VBA - error 5479 - Bug??

I

Ingo Weber

Hi there,

(Word 2003 with or without SP1, german version)

i have a severe problem with word 2003.
I have a complex program, managing small word documents to make manuals etc.
It runs with Word 97 to Word XP. But with Word 2003 i have some problems. I
reduced the problem to a documents.open - command. To get a small,
reproducible test-program , i made the following simple mini-program, which
shows the same strange effects:

One Main program, just showing a userform:

Sub main()
UserForm1.Show
End Sub

The form Userform1 just have one button with this code on the click-event:

Private Sub CommandButton1_Click()
Dim obj As Object
Set obj = Documents.Open(FileName:="F:\bs175.doc")
End Sub
or
Private Sub CommandButton1_Click()
Documents.Open FileName:="F:\bs175.doc"
End Sub
or
Private Sub CommandButton1_Click()
Dim obj As Word.Document
Set obj = Documents.Open(FileName:="F:\bs175.doc")
End Sub

The file F:\bs175.doc exists. F: is a local path.

Thats it. Now the effect:

Starting Word and starting the macro by tools/Macros/run results in an
error-message:

Runtime error 5479
Microsoft Office Word can not close, because a Dialog box is open....

If I open the visual basic editor and run the macro, everything is fine.
Even if the Visual Basic Editor have just been opened once in the
Word-Session, the error will not appear again in this session. Even if I
close the Visual Basic Editor.

I am really astonished, that such a simple example could produce the
error-message, but its true on my system.
It would be very nice, if you could tell me, whether its an effect just on
my computer or whether you can reproduce the problem as well.

Meanwhile I tested the same on another machine: same effect
But the effect only comes, if the macro with the form is in a template,
which is in the autostart-directory.
(I put it in the normal.dot)

Any hints, how to avoid the problem, are welcome.

Thanks in advance and sorry for my bad english

Ingo
 

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