Format Date in Save AS function

G

Greg H.

I am receiving a strange error message when trying to run the below script:

ActiveWorkbook.SaveAS "c:\Daily Reports for DP\NPP_" & Format(Date,
"mmddyy")

The error i get highlights "Format" and a msg box says:

Compile Error:

Wrong number of arguments or incalid property assignment

Any ideas as to what is wrong?
 
T

Tom Ogilvy

You have probably used Format as the name of a routine you wrote. Find that
routine and change the name.
 
F

Ferris

I am receiving a strange error message when trying to run the below script:

ActiveWorkbook.SaveAS "c:\Daily Reports for DP\NPP_" & Format(Date,
"mmddyy")

The error i get highlights "Format" and a msg box says:

Compile Error:

Wrong number of arguments or incalid property assignment

Any ideas as to what is wrong?

I'm not able to reproduce your error, your code (I modified the path a
bit for my machine) worked just fine for me. Tested on both xl2007 and
xl2003.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Save Workbook As macro problem 5
Date Format 7
Date Format 3
File Save As macro for users with different paths 6
File SaveAs 4
Format code no longer works 5
XNPV in VBA 2
save as cell A1 to to a specific drive 3

Top