Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() -- HTH Bob Phillips "Gary Gepner" wrote in message om... I want to prompt user with a windows dialog from vba and want user to pick a file, but I want to be able to specify file directory and name. I looked at GetOpenFilename, preceded by a chdir command, but I am not able to default to a specific name. ChDir ActiveWorkbook.Path GlbGetFileName = Application.GetOpenFilename _ (fileFilter:="Text Files (*.txt),*.txt", _ FilterIndex:=1, _ Title:="Choose a directory and file name to run the Report") If GlbGetFileName = "False" Then Close Exit Sub End If I then went back and remembered the GetSaveAsFilename method, might do what I want. (it doesn't save a file, just displays the list). This works functionally perfectly, but the only problem is it displays a Save button. GlbGetFileName = Application.GetSaveAsFilename _ (InitialFilename:="c:\bcsits\bcsitsout.txt", _ fileFilter:="Text Files (*.txt), *.txt", _ FilterIndex:=1, _ Title:="Choose a directory and file name to run the Report") If GlbGetFileName = "False" Then Close Exit Sub End If Any suggestions? Gary Gepner |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
User replaces existing file with blank during file open | Excel Discussion (Misc queries) | |||
Macro To Open a User selected File | Excel Worksheet Functions | |||
Dialog prompt during opening of file | New Users to Excel | |||
How do I change file/open/"files of type" to default to "all file. | Excel Discussion (Misc queries) |