excel2000

G

Guest

i want to build a macro that save the current file in a new name

the new name is known sach "file1"
but the directory is variable according the user
directory which from ther he open the current file

the macro will save the file and replace an older one
in the current directory
i made this macro
ActiveWorkbook.SaveAs Filename:= _
"TzOld.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

i copied the current file from directory YYY to another directory
I open the file from the new directory but when
i opperated the macro he saved the file in directory YYY

thank you
rozent
 
D

Dave Peterson

You can use activeworkbook.path to obtain the folder that holds the
activeworkbook:

ActiveWorkbook.SaveAs Filename:=activeworkbook.path & "\" & "TzOld.xls", _
.............


I don't understand about File1, though.
 

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


Top