Save-As Macro

M

Mike Kiekover

I need a simple Save-As macro but I need to save to the current name and
path (overwrite)

It's easy to record a macro to do the Save-As command, but it uses the
specific file name and path in the script. Is there a string that will just
reference the current file name in the current directory, so the macro will
work in any file without having to modify it. Don't ask me why, but I need
to do a Save-As as opposed to a Save to make a different macro work.
Save -As must do something slightly different.

Below is what I have now

************
ActiveWorkbook.SaveAs Filename:= _
"Q:\COP\06-243 FCC Energy Recovery Detailed\ENGINEER\Lists\PN
2005044 Piping Line List Rev 0.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
************
 
D

Dave Peterson

with activeworkbook
.saveas filename:=.fullname, .....


Maybe you're removing passwords????

with activeworkbook
.Password = ""
.save
end with

????
 
G

Gord Dibben

Mike

Application.DisplayAlerts = False

ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "\" & _
ThisWorkbook.Name

Application.DisplayAlerts = True


Gord Dibben MS Excel MVP
 

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