Need Help with VBA SaveAs

M

March

Hello All,


I try to change the code below to be generic code in my project:

ChDir "L:\TEST \Revision"
ActiveWorkbook.SaveAs FileName:= _
"L:\TEST\Revision\Test080408V10.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False

Above code, I record from Excel Macro.

I try to write it generic like below that is incorrect syntax:

ChDir CurrentProject.Path
ActiveWorkbook.SaveAs FileName:= _
‘†& CurrentProject.Path & “’, FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False

I don't know what should that be. Please anyone help me.


Thank you,

March
 
K

Klatuu

All you really need is:

ActiveWorkbook.SaveAs FileName:= CurrentProject.Path & strFileName

CurrentProject.Path will not have the name of the workbook, so you need to
include it.

The other are all defaults so there is no need to include them.
 

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