Hi. I am having trouble specifying the folder I want when using GetOpenFilename. It takes me to the folder I want but there are no excel files in there.
Application.GetOpenFilename("Folder Path, Excel Files (*.xls)")
Any pointers?
Hi. I am having trouble specifying the folder I want when using GetOpenFilename. It takes me to the folder I want but there are no excel files in there.
Application.GetOpenFilename("Folder Path, Excel Files (*.xls)")
Any pointers?
You are using Excel 2010 so try changing the file extension to Application.GetOpenFilename("Folder Path, Excel Files (*.xlsx)")
Elegant Simplicity............. Not Always
In fact it doesn't even take me to the folder I want. Nevertheless I changed it to xlsx and there were no excel files in a folder that I know has excel files.
Could it be it is not locating the Folder because the path is not in my documents but on another drive on my server?
Best way to get the full file path is to navigate to it with explorer then copy the name from the filepath display at the top..
In my experience you have to be a bit careful with shared drives across networks because I.T. move files to another server occasionally as part of maintenance....
You could aslo just use asterixes in the file type just to verify you are looking into the right folder.
What if it is a 97-2003 excel file?
Then it should be an .xls extension...... but looking more closely ..
Try this
or even![]()
Dim f As Variant f = Application.GetOpenFilename("All Files (*.*),*.*") If f <> False Then Workbooks.Open Filename:=f End If
That's in it's simplest form which will open the current folder![]()
Application.GetOpenFilename ("All Files (*.*),*.*")
I think the Folder Path you specify in your code is a string variable and should not be enclosed in quotes.
Last edited by AndyLitch; 04-24-2013 at 07:10 AM.
GetOpenFilename does not provide the ability to select a folder. you could use chdrive and chdir to change the current path before showing the dialog
Josie
if at first you don't succeed try doing it the way your wife told you to
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks