Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
How can I get a file dialog box to come up in my code (or when I press a button) and return the file name that I select? -- Steve R |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Are you trying to find an existing file?
Look at application.getopenfilename in VBA's help. Are you trying to allow the user to specify any file (like to save a workbook): look at application.getsaveasfilename in vba's help. Each of these will return the name chosen--but won't do more with it. You have to do that yourself. dim myFileName as variant 'in case user cancels myfilename = application.getopenfilename if myfilename = false then msgbox "try later" 'cancel exit sub end if msgbox myfilename Steve wrote: Hi, How can I get a file dialog box to come up in my code (or when I press a button) and return the file name that I select? -- Steve R -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Perfect, Thank you
-- Steve R "Dave Peterson" wrote: Are you trying to find an existing file? Look at application.getopenfilename in VBA's help. Are you trying to allow the user to specify any file (like to save a workbook): look at application.getsaveasfilename in vba's help. Each of these will return the name chosen--but won't do more with it. You have to do that yourself. dim myFileName as variant 'in case user cancels myfilename = application.getopenfilename if myfilename = false then msgbox "try later" 'cancel exit sub end if msgbox myfilename Steve wrote: Hi, How can I get a file dialog box to come up in my code (or when I press a button) and return the file name that I select? -- Steve R -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
File Browse Function (Open dialog box for choosing file) | Excel Programming | |||
open file dialog-select file-import worksheet | Excel Programming | |||
Prompt user to select file with default file selected dialog | Excel Programming | |||
Prompt user to select file with default file selected dialog | Excel Programming | |||
Prompt user to select file with default file selected dialog | Excel Programming |