Forum Discussion
pedrohrmoreira
Jun 17, 2020Copper Contributor
Run-time '1004' Save
Hi all, I'm having some issues with a Save As macro I'm trying to run. It is exactly the same code I use for a separate report (which works fine), however, on this one, I seem to continuously get...
Subodh_Tiwari_sktneer
Jun 17, 2020Silver Contributor
You should declare a String variable to hold the dynamic file name and assign dynamic file name to this variable and use debug.print to print the variable in the Immediate Window and see if the filename is a valid file name.
Dim strFileName As String
strFileName = strgenericfilepath & strpackingbranch & stryear & strmonth & strday & strfilename
Debug.Print strFileName
'SaveAs statement here