Article ID: 142137
Article Last Modified on 10/11/2006
Sub Test()
Dim X As Boolean
Do
X = Application.Dialogs(xlDialogOpen).Show
' X returns False if the box is canceled.
If X = False Then MsgBox "Please select a file to open."
' X equals True when you open the file.
Loop Until X = True
End Sub
When you run this sample macro, the Open dialog box is displayed. If you
try to cancel the dialog box, the macro prompts you with a message box.
When you click OK in this message box, you are returned to the Open dialog
box. This process continues until you select a file to open.
139723 How to Display the Open and Save As Dialog Boxes
213371 XL2000: How to Display the Open and Save As Dialog Boxes
Additional query words: 5.00a 5.00c XL97 XL98 XL7 XL5 XL
Keywords: kbdtacode kbhowto kbprogramming KB142137