Please Help Procedure not working
I have used the following code in my reports for months,
[vba]
Sub filename(reportname As String, reportpath As String)
Dim NewFile As String
NewFile = reportname & CStr(format(Date, "mm-dd-yy")) & ".xls"
MsgBox prompt:="Your new file will be named " & NewFile
ActiveWorkbook.SaveAs filename:=reportpath & NewFile
End Sub
[/vba]
Now when I use it in a call (Example "Call filename("Pro Generics Compliance ", "X:\Purchasing\NRC Tasks\Daily\Jack's Tasks\Pro Generics Compliance\Archive\")
I am getting the format in the first line of code as a Compile error.
Can understand why this has worked for so long and now isn't.
Any help would be greatful.
Thanks
Jack
Answer but not undrestood
I had a Macro witht the title of "Format" in the Series of VBA I have for my reports.
I do not understand how this "Format" title of a Macro that was written could cause the problem I posted above.
Jack