Format code no longer works

G

Guest

Hi All.........

I've used this line of code in past workbooks and it worked fine for
appending a date on the end of a filename

Fname = Fname & Format(Date, "_Mmm_dd_yyyy")

Now, I'm trying the same thing in a new workbook, after a re-install of my
XL97, and I get the following error msg

"Compile Error,,,Wrong number of arguments or invalid property assignment"

Anybody know what the trouble might be?

TIA
Vaya con Dios,
Chuck, CABGx3
 
G

Guest

That fname thing was from the old workbook...

Actually, this is the code I'm trying to use now, which works fine......
ActiveWorkbook.SaveAs FileName:=CurrentPath & "\" & MyName & ".xls"

It's when I try to add the date is when I get the problem......
ActiveWorkbook.SaveAs FileName:=CurrentPath & "\" & MyName & Format(Date,
"_Mmm_dd_yyyy") & ".xls"

Vaya con Dios,
Chuck, CABGx3
 
G

Guest

It sounds like you have created a custom sub or function with the name
FORMAT. If so, rename it or delete it.
 
C

CLR

Indeed, you are correct Tom......changed the name, solved the
problem...........many many thanks, kind Sir!

Vaya con Dios,
Chuck, CABGx3
 
C

CLR

Indeed, you are correct Tom......changed the name, solved the
problem...........many many thanks, kind Sir!

Vaya con Dios,
Chuck, CABGx3
 

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

Top