RaunLGoode
Registered User.
- Local time
- Today, 05:36
- Joined
- Feb 18, 2004
- Messages
- 122
I have a report generated in Excel. I would like to Save the report as "Employee Name-Date", using the following code:
ActiveWorkbook.SaveAs Filename:= _
"\\[Path]\" & CName & "-" & WEDate & ".xls", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
When I try th execute the code I get an error. When I remove the Date Variable (In Red) the code runs with no error. I suspect the problem lies in the date data type of the date variable. There must be a way to modify the variable so I can use it as part of the file name. Could somebody give me some help?
ActiveWorkbook.SaveAs Filename:= _
"\\[Path]\" & CName & "-" & WEDate & ".xls", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
When I try th execute the code I get an error. When I remove the Date Variable (In Red) the code runs with no error. I suspect the problem lies in the date data type of the date variable. There must be a way to modify the variable so I can use it as part of the file name. Could somebody give me some help?