GreenyMcDuff
Active Member
- Joined
- Sep 20, 2010
- Messages
- 313
Hi all,
I am using this code to save a WorkBook:
I want the file name (if today's month is June) to be:
"Client Product Report 2011-May.xls"
When I compile the project the debugger highlights the word "Format" and says "Wrong number of arguments or invalid property assignment"
I assume I have syntaxed the Format incorrectly but after having scoured Google for quite sometime I can't find anything that suggests it is wrong.
Hopefully someone here can help
Thanks
Chris
I am using this code to save a WorkBook:
Code:
ActiveWorkbook.SaveAs Filename:="H:\VBA Macros\Barnwell, Robin\Client Product Report " & [COLOR=red]Format[/COLOR](DateSerial(Year(Now), Month(Now()) - 1, 0), "yyyy-mm"), FileFormat:= _
xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
, CreateBackup:=False
I want the file name (if today's month is June) to be:
"Client Product Report 2011-May.xls"
When I compile the project the debugger highlights the word "Format" and says "Wrong number of arguments or invalid property assignment"
I assume I have syntaxed the Format incorrectly but after having scoured Google for quite sometime I can't find anything that suggests it is wrong.
Hopefully someone here can help
Thanks
Chris