Advertisement
mdelatorre

Displays the File Open box with VBA

May 24th, 2012
411
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub TestIt()
  2. NewFN = Application.GetOpenFilename(FileFilter:="Excel Files (*.xls), *.xls", Title:="Please select a file")
  3. If NewFN = False Then
  4. ' They pressed Cancel
  5. MsgBox "Stopping because you did not select a file"
  6. Exit Sub
  7. Else
  8. Workbooks.Open Filename:=NewFN
  9. End If
  10. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement