ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Format Date in Save AS function (https://www.excelbanter.com/excel-programming/396273-format-date-save-function.html)

Greg H.[_3_]

Format Date in Save AS function
 
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?

Tom Ogilvy

Format Date in Save AS function
 
You have probably used Format as the name of a routine you wrote. Find that
routine and change the name.

--
Regards,
Tom Ogilvy

"Greg H." wrote:

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?


Greg H.[_3_]

Format Date in Save AS function
 
I am not worthy. Thank you so much for that light bulb moment.

"Tom Ogilvy" wrote:

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

--
Regards,
Tom Ogilvy

"Greg H." wrote:

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?


Ferris[_2_]

Format Date in Save AS function
 
On Aug 24, 12:56 pm, Greg H. wrote:
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.



All times are GMT +1. The time now is 07:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com