A
Art®
Sometime back I created a Word macro that called up a custom dialog box with
several directory choices. When the user clicked on one of these, it opened
the built-in File Open dialog so the user could click on a file in the
specified directory. The macro worked fine in Office 2000, but when I run it
in Office 2003, it gives me the following error message:
Run-time error '5479': You cannot close Microsoft Office Word because a
dialog box is open. Click OK, switch to Word, and then close the dialog box.
According to Microsoft, Office 2000 VBA macros should work the same in
Office 2003.
The bottom portion of the macro, starting at the "With" statement, works
fine as a stand alone macro, but when used as part of the larger macro in
combination with the custom dialog box will not work in Office 2003.
A portion of the macro is listed below:
Sub art()
doc$ = "c:\Documents and Settings\owner\My documents\"
If OptionButton1.Value = True Then ChangeFileOpenDirectory doc$
If OptionButton2.Value = True Then ChangeFileOpenDirectory doc$ + "Arts"
If OptionButton3.Value = True Then ChangeFileOpenDirectory doc$ + "BJ"
With Dialogs(wdDialogFileOpen)
.Name = "*.*"
.Show
End With
End Sub
I would appreciate any help you could offer. I have tried a variety of work
arounds, including error trapping, but nothing has worked.
Art
several directory choices. When the user clicked on one of these, it opened
the built-in File Open dialog so the user could click on a file in the
specified directory. The macro worked fine in Office 2000, but when I run it
in Office 2003, it gives me the following error message:
Run-time error '5479': You cannot close Microsoft Office Word because a
dialog box is open. Click OK, switch to Word, and then close the dialog box.
According to Microsoft, Office 2000 VBA macros should work the same in
Office 2003.
The bottom portion of the macro, starting at the "With" statement, works
fine as a stand alone macro, but when used as part of the larger macro in
combination with the custom dialog box will not work in Office 2003.
A portion of the macro is listed below:
Sub art()
doc$ = "c:\Documents and Settings\owner\My documents\"
If OptionButton1.Value = True Then ChangeFileOpenDirectory doc$
If OptionButton2.Value = True Then ChangeFileOpenDirectory doc$ + "Arts"
If OptionButton3.Value = True Then ChangeFileOpenDirectory doc$ + "BJ"
With Dialogs(wdDialogFileOpen)
.Name = "*.*"
.Show
End With
End Sub
I would appreciate any help you could offer. I have tried a variety of work
arounds, including error trapping, but nothing has worked.
Art