Get Open File Name

K

kiza

Hi,

I am trying to open a file from a folder but at the moment, not havin
much sucess. I have written the following VB code:

fileToOpen = Application _
.GetOpenFilename("Text Files (*.txt), *.txt")
If fileToOpen <> False Then
MsgBox "Open " & fileToOpen
End If

However, this only allows me to select Text Files and I am mainl
interested in .xls files. I have managed to get the folder box open bu
I cannot open any Excel files.

Have I missed something out?

If there is any one who can help me in my quest, that would be cool.
Thanks
Kiz
 
M

mudraker

Try


fileToOpen = Application _
.GetOpenFilename("ExcelFiles (*.xls), *.xls")
If fileToOpen <> False Then
MsgBox "Open " & fileToOpen
End I
 

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