Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display the "File Open" Dialog Box

Status
Not open for further replies.

mattj63

Technical User
Jan 5, 2005
30
US
I'm trying to open an Excel file via a macro. However, I want the user to be able to select the file rather than hardcoding the file as in the command:
Code:
Workbooks.Open Filename:= "C:Sample.csv"
Should be easy right? But I can't find it in the VBA help.
 
Now I find it!

Code:
fileToOpen = Application _
    .GetOpenFilename("Text Files (*.txt), *.txt")
If fileToOpen <> False Then
    MsgBox "Open " & fileToOpen
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top