Cowboy_BeBa
Registered User.
- Local time
- Today, 20:14
- Joined
- Nov 30, 2010
- Messages
- 188
hi all
im trying to open the windows filebrowser (preferably to a specific folder, if folder doenst exist then it can open to wherever)
Once the user selects a file id like to be able to store the filename and path in a variable and mess around with it later (preferably would like to store the name separately from the path but not completely necessary)
after some googling i found the following code which does invoke the file browser, but it does not show me the name/path of the file chosen
all it does is give me a count of the items selected (tried changing SelectedItems.count to .value but that caused a runtime error)
im trying to open the windows filebrowser (preferably to a specific folder, if folder doenst exist then it can open to wherever)
Once the user selects a file id like to be able to store the filename and path in a variable and mess around with it later (preferably would like to store the name separately from the path but not completely necessary)
after some googling i found the following code which does invoke the file browser, but it does not show me the name/path of the file chosen
all it does is give me a count of the items selected (tried changing SelectedItems.count to .value but that caused a runtime error)
Code:
Dim f As Object
Set f = Application.FileDialog(3)
Dim path As String
f.AllowMultiSelect = False
f.Show
MsgBox "file choosen = " & f.SelectedItems.Count