Saving a File

  • Thread starter Thread starter scott
  • Start date Start date
S

scott

I'm trying to set the folder where I want the user to be in before invoking
the open/save dialog. The "ChDir" command isn't changing the current folder.
Can someone tell me the right code to change the current folder?

ChDir "S:\Spreadsheets"

Application.Dialogs(xlDialogSaveAs).Show
 
Dim startingname As String
startingname ="FILE NAME"
Dim myFileName As Variant
myFileName = Application.GetSaveAsFilename _
(InitialFileName:="c:\" & startingname)

If myFileName = False Then
'user hit cancel
Else
ActiveWorkbook.SaveAs Filename:=myFileName,
FileFormat:=xlNormal
End If
 
Back
Top