ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   save a backup copy in different folder (https://www.excelbanter.com/excel-discussion-misc-queries/88098-save-backup-copy-different-folder.html)

GT

save a backup copy in different folder
 
Is there a way to save a backup copy od xl2k workbook in a DIFFERENT folder
than the original? With mutliple workbooks folder becomes too cluttered.

Thx

CLR

save a backup copy in different folder
 
Here's some code that might do the job you want.........

Sub SaveArchive2()
' ================================================== =========
' Saves the workbook to a predetermined Archive Directory and appends date
and time to filename,
' then re-configures file so it will naturally be saved to the directory
from whence it came.
'
================================================== ============================
CurrentPath = CurDir
ArchivePath = "c:\TypeYourArchivePathHere"
WorkBookName = ActiveWorkbook.Name
FName = ArchivePath
FName = FName + Worksheets("Sheet1").Range("AH36").Value 'Used to name
archived file to cell value
FName = FName + Str(Hour(Time)) + "_" + Str(Minute(Time)) + "_" +
Str(Second(Time))
FName = FName + "_" + Str(Month(Date)) + "_" + Str(Day(Date)) + "_" +
Str(Year(Date))

Application.DisplayAlerts = False
ActiveWorkbook.SaveAs FName
FName = CurrentPath + "\" + WorkBookName
ActiveWorkbook.SaveAs FName
Application.DisplayAlerts = True
End Sub

hth
Vaya con Dios,
Chuck, CABGx3


"GT" wrote:

Is there a way to save a backup copy od xl2k workbook in a DIFFERENT folder
than the original? With mutliple workbooks folder becomes too cluttered.

Thx


GT

save a backup copy in different folder
 
Thanks Chuck--Unfortunately I know nothing about programming, so unless these
are easy changes I guess I'm out of luck.

ps I liked your summary. I got most of it except the MMOUS2k?

"CLR" wrote:

Here's some code that might do the job you want.........

Sub SaveArchive2()
' ================================================== =========
' Saves the workbook to a predetermined Archive Directory and appends date
and time to filename,
' then re-configures file so it will naturally be saved to the directory
from whence it came.
'
================================================== ============================
CurrentPath = CurDir
ArchivePath = "c:\TypeYourArchivePathHere"
WorkBookName = ActiveWorkbook.Name
FName = ArchivePath
FName = FName + Worksheets("Sheet1").Range("AH36").Value 'Used to name
archived file to cell value
FName = FName + Str(Hour(Time)) + "_" + Str(Minute(Time)) + "_" +
Str(Second(Time))
FName = FName + "_" + Str(Month(Date)) + "_" + Str(Day(Date)) + "_" +
Str(Year(Date))

Application.DisplayAlerts = False
ActiveWorkbook.SaveAs FName
FName = CurrentPath + "\" + WorkBookName
ActiveWorkbook.SaveAs FName
Application.DisplayAlerts = True
End Sub

hth
Vaya con Dios,
Chuck, CABGx3


"GT" wrote:

Is there a way to save a backup copy od xl2k workbook in a DIFFERENT folder
than the original? With mutliple workbooks folder becomes too cluttered.

Thx


CLR

save a backup copy in different folder
 
Lol..........MMOUS2k stands for Master Microsoft Office User Specialist, in
Office 2000. an old certification that Microsoft had several years ago.

As for the code.......You're welcome to it, of course, however if you're
just beginning, it may be a bit much for a first bite. Hopefully you might
have a local Guru, that might can help you to cut and paste it into a regular
code module and make the necessary modifications for you to be able to use it
in your system. It does require a bit of tailoring. For the time being, the
best solution to your problem might be to ignore the code solution, and just
go into Windows Explorer and Copy and Paste the saved file over to another
Directory, and modify the filename slightly, like by adding the date, so one
won't cancel out the other as you add future copies. And of course you can
always do File SaveAs to place the file somewhere else......you just have
to be careful if you're one who likes to open the file from the Excel File
menu, that you get the correct and current version each time.........hope
some of this is helpful.

Vaya con Dios,
Chuck, CABGx3






"GT" wrote:

Thanks Chuck--Unfortunately I know nothing about programming, so unless these
are easy changes I guess I'm out of luck.

ps I liked your summary. I got most of it except the MMOUS2k?

"CLR" wrote:

Here's some code that might do the job you want.........

Sub SaveArchive2()
' ================================================== =========
' Saves the workbook to a predetermined Archive Directory and appends date
and time to filename,
' then re-configures file so it will naturally be saved to the directory
from whence it came.
'
================================================== ============================
CurrentPath = CurDir
ArchivePath = "c:\TypeYourArchivePathHere"
WorkBookName = ActiveWorkbook.Name
FName = ArchivePath
FName = FName + Worksheets("Sheet1").Range("AH36").Value 'Used to name
archived file to cell value
FName = FName + Str(Hour(Time)) + "_" + Str(Minute(Time)) + "_" +
Str(Second(Time))
FName = FName + "_" + Str(Month(Date)) + "_" + Str(Day(Date)) + "_" +
Str(Year(Date))

Application.DisplayAlerts = False
ActiveWorkbook.SaveAs FName
FName = CurrentPath + "\" + WorkBookName
ActiveWorkbook.SaveAs FName
Application.DisplayAlerts = True
End Sub

hth
Vaya con Dios,
Chuck, CABGx3


"GT" wrote:

Is there a way to save a backup copy od xl2k workbook in a DIFFERENT folder
than the original? With mutliple workbooks folder becomes too cluttered.

Thx



All times are GMT +1. The time now is 12:45 AM.

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