Using the Standard "Open File" dialog box
Posted by Geoff on June 19, 2001 12:30 PM
The following is an example of how do use the "Open File" dialog box according to the VBA help files:
fileToOpen = Application _
.GetOpenFilename("Text Files (*.txt), *.txt")
If fileToOpen <> False Then
MsgBox "Open " & fileToOpen
End If
My code looks exactly like this (aside from the MsgBox) but when a user chooses a file to Open, I get a "Type Mismatch" error for the If condition since fileToOpen contains a path now, and not a boolean. I have this feeling I'm missing something obvious but I'm not sure what it is.
Thanks,
Geoff