ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I reference my current file in saveas function? (https://www.excelbanter.com/excel-programming/325970-how-do-i-reference-my-current-file-saveas-function.html)

BrookStevenson

How do I reference my current file in saveas function?
 
On a monthly basis, I need to save a lot of templates, located in different
folders. The locations of each folder has a folder named UPDATED located in
the same directory. Furthermore, I need to have UPDATED added to the end of
each file name. This is what I've come up with so far:

ActiveWorkbook.SaveAs "..\UPDATED\" & FILENAME & " UPDATED.xls"

This saves the file in the correct place, but only as "UPDATED.xls". Is
there a function that I can put in the place of FILENAME that will reference
what ever file is currently active, in a way that allows me to add UPDATED to
the end of it?

Tom Ogilvy

How do I reference my current file in saveas function?
 
Filename = Left(activeworkbook.name,len(activeworkbook.name)-4)
ActiveWorkbook.SaveAs "..\UPDATED\" & FILENAME & " UPDATED.xls"

--
Regards,
Tom Ogilvy

"BrookStevenson" wrote in message
...
On a monthly basis, I need to save a lot of templates, located in

different
folders. The locations of each folder has a folder named UPDATED located

in
the same directory. Furthermore, I need to have UPDATED added to the end

of
each file name. This is what I've come up with so far:

ActiveWorkbook.SaveAs "..\UPDATED\" & FILENAME & " UPDATED.xls"

This saves the file in the correct place, but only as "UPDATED.xls". Is
there a function that I can put in the place of FILENAME that will

reference
what ever file is currently active, in a way that allows me to add UPDATED

to
the end of it?





All times are GMT +1. The time now is 10:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com