I have the following code for a Save As Dialog Boc
I have set a value to Initialname and I have specified that InitialFileName:=Initialname which then is supposed to set a default Save As name in the dialog box
Initialname = targetSheet.Range("BP37") & "-Imported"
fileSaveName = Application.GetSaveAsFilename(InitialFileName:=Initialname, FileFilter:="Excel Files (*.xlsm), *.xlsm", title:="Save As")
If fileSaveName <> False Then
ThisWorkbook.SaveAs Filename:=fileSaveName
MsgBox Initialname
When code is ran :
1.) Dialog box works except that InitialFileName=Initialname does not show in box - there is nothing showing as default file name
2.) If I type in a filename and click save the file is saved using the name entered
3.) the MsgBox does appear and does show the correct value for Initialname
So it appears to me that InitialFileName:= function is either not working or I am missing something in syntax?
Thanks in advance for any assistance
I have set a value to Initialname and I have specified that InitialFileName:=Initialname which then is supposed to set a default Save As name in the dialog box
Initialname = targetSheet.Range("BP37") & "-Imported"
fileSaveName = Application.GetSaveAsFilename(InitialFileName:=Initialname, FileFilter:="Excel Files (*.xlsm), *.xlsm", title:="Save As")
If fileSaveName <> False Then
ThisWorkbook.SaveAs Filename:=fileSaveName
MsgBox Initialname
When code is ran :
1.) Dialog box works except that InitialFileName=Initialname does not show in box - there is nothing showing as default file name
2.) If I type in a filename and click save the file is saved using the name entered
3.) the MsgBox does appear and does show the correct value for Initialname
So it appears to me that InitialFileName:= function is either not working or I am missing something in syntax?
Thanks in advance for any assistance