Help with FileDialog Access 2003

  • Thread starter Thread starter Terry Olsen
  • Start date Start date
T

Terry Olsen

I'm trying to open a Browse for file dialog box. But I get errors:

1. Dim statement gives me a "Type Mismatch" error.
2. When I remove the Dim statement, the Set statement give me a "method
failure" error.

Can anyone help? Thanks.

Public Function BrowseForExe() As String
Dim dlgOpen As Application.FileDialog
Set dlgOpen = Application.FileDialog(msoFileDialogFilePicker)

With dlgOpen
.AllowMultiSelect = False
.Show
BrowseForExe = dlgOpen.Path
End With

End Function
 
I'm not sure, how about dim it as an object only, i.e.,

Dim dlgOpen As Object

Herbert
 
Back
Top