Fun with GetOpenFilename

W

WhytheQ

Hello,

The follwoing works ok:

'================================================================
MyXlPathway = Application.GetOpenFilename("Excel Files (*.xls),*.xls,"
& _
"Excel Files (*.xlsx),*.xlsx," & _
"Excel Files (*.xlsm),*.xlsm," & _
"Add-in Files (*.xla),*.xla", , "Select
Excel file or add-in for XL Start-up")
'================================================================

but I'd like it so that all the file types are displayed as soon as
the Open File window appears - with the above the user has to select
the file type using the bottom combobox to make those files visible.

Any help appreciated
Jason.
 
R

reklamo

Hi Jason
Just remove all the stuff behind GetOpenFilename:

MyXlPathway = Application.GetOpenFilename

regards
reklamo
 
J

Jon Peltier

But that might let the user think he could select, say, a PowerPoint
presentation.

Try this:

MyXlPathway = Application.GetOpenFilename( _
"Excel Files
(*.xls;*.xlsx;*.xlsm;*.xla;*.xlam),*.xls;*.xlsx;*.xlsm;*.xla;*.xlam", , _
"Select Excel file or add-in for XL Start-up")

- Jon
 
D

Dave Peterson

I like Jon's reply, but if you want, maybe...

Dim myFileName As Variant
myFileName = Application.GetOpenFilename(Filefilter:="All Files, *.*")
 
W

WhytheQ

I like Jon's reply, but if you want, maybe...

    Dim myFileName As Variant
    myFileName = Application.GetOpenFilename(Filefilter:="All Files, *.*")










--

Dave Peterson- Hide quoted text -

- Show quoted text -



Thanks to everyone for the help - all worked fine. I used something
very similar to Jon's.
Jason.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top