excel2000
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 |
excel2000
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. ????? wrote: 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 -- Dave Peterson |
excel2000
thank you david
your macro solved my problem rozent "Dave Peterson" wrote: 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. ????? wrote: 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 -- Dave Peterson |
All times are GMT +1. The time now is 06:21 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com