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
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