Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Matt
first question: Your current drive is not C:? So you may change the code to Sub foo() Dim fileSaveName Dim path as string ..... ChDrive "C:" ChDir "C:\" fileSaveName = Application.GetSaveAsFilename( _ InitialFilename:=fileToOpen, _ fileFilter:="Excel Files (*.xls), *.xls") If fileSaveName < False Then MsgBox "Save as " & fileSaveName End If .... end sub The lines If fileSaveName < false then msgbox " Save as " & fileSaveName end if are just 'dummy code'. The If clause checks if you have pressed 'OK' in the dialog and if this is true displays the filename (without doing anything else). You have to adapt these lines to your specific needs (save the file, etc.) -- Regards Frank Kabel Frankfurt, Germany Matt wrote: Thanks Frank. I have a couple of questions. What does the following do? If fileSaveName < false then msgbox " Save as " & fileSaveName end if Also, when I put in the ChDir "C:\" it changes it to lowercase. Is this normal? Even with this in the code, it doesn't seem to work right. It still goes back to the last accessed directory. Thanks for your help. Matt |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Function Arguments dialog vanishes when clicked an inserted shape | Excel Worksheet Functions | |||
Can you Pre-fill file name in SaveAs dialog | Excel Worksheet Functions | |||
How to delete the "Insert Function Dialog Box" (dialog box only)? | Excel Worksheet Functions | |||
SaveAs dialog | Excel Discussion (Misc queries) | |||
Sort Dialog Arguments | Excel Programming |