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
Herbert Chan - 06 Jan 2005 11:23 GMT
I'm not sure, how about dim it as an object only, i.e.,
Dim dlgOpen As Object
Herbert
> I'm trying to open a Browse for file dialog box. But I get errors:
>
[quoted text clipped - 15 lines]
>
> End Function
Douglas J. Steele - 06 Jan 2005 21:35 GMT
Far better to use the API approach outlined in
http://www.mvps.org/access/api/api0002.htm at "The Access Web"

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
> I'm trying to open a Browse for file dialog box. But I get errors:
>
[quoted text clipped - 15 lines]
>
> End Function
Terry Olsen - 07 Jan 2005 01:50 GMT
Hey, that worked great. Thanks!
> Far better to use the API approach outlined in
> http://www.mvps.org/access/api/api0002.htm at "The Access Web"
[quoted text clipped - 18 lines]
>>
>> End Function