View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Martin Fishlock[_4_] Martin Fishlock[_4_] is offline
external usenet poster
 
Posts: 32
Default macros opening files

Try

fileToOpen = Application.GetOpenFilename( _
"Excel Files (*.csv;*.xls), *.csv;*.xls")

or

fileToOpen = Application.GetOpenFilename( _
"Comma Seperated Value Files (*.csv),*.csv,Excel Files (*.xls),*.xls")

--
HTHs Martin


"MSHO" wrote:

Hello

I have a macro that prompts the user to open a file. Currently it is a .csv
file but i want it to be able to open .csv or .xls. This is my code:

fileToOpen = Application.GetOpenFilename("Excel Files (*.csv), *.csv")

Is there a way i can add an OR or AND somehow or make it be able to open any
sort of file?

Thanks in Advance