Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there any macro when i run it will take a backup of
my excel file in c:\mydata folder. Thanks in Advance. ****al |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
****al,
Try something like ThisWorkbook.SaveCopyAs filename:="C:\mydata\" & Thisworkbook.Name -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "****al" wrote in message ... Is there any macro when i run it will take a backup of my excel file in c:\mydata folder. Thanks in Advance. ****al |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here is a macro I use to backup to the active folder. Modify to suit.
Sub Backup() 'kept in personal.xls & assigned to toolbar button On Error GoTo BackupFile MkDir CurDir & "\Backup" BackupFile: With ActiveWorkbook MyWB = .Path & "\BACKUP\" & .Name .SaveCopyAs MyWB .Save End With End Sub "****al" wrote in message ... Is there any macro when i run it will take a backup of my excel file in c:\mydata folder. Thanks in Advance. ****al |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
****al,
See the code below. This will save the backup with a date/time appended to the name, to allow multiple backups. HTH, Bernie MS Excel MVP Sub BUandSave() 'Saves the current file to "mydata" backup folder and its own folder Application.DisplayAlerts = False ActiveWorkbook.SaveCopyAs FileName:="C:\mydata \" & _ Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 4) & _ " BU " & Format(Now, " yyyy-mm-dd hh-mm") & ".xls" ActiveWorkbook.Save Application.DisplayAlerts = True End Sub "****al" wrote in message ... Is there any macro when i run it will take a backup of my excel file in c:\mydata folder. Thanks in Advance. ****al |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
****al
Sub BUandSave2() 'Saves the current file to a backup folder and the default folder if desired 'Note that any previous backup is overwritten Application.DisplayAlerts = False ActiveWorkbook.SaveCopyAs FileName:="C:\mydata\" & _ ActiveWorkbook.Name ''ActiveWorkbook.Save''add this line if you want to save to default folder also Application.DisplayAlerts = True End Sub Gord Dibben XL2002 On Mon, 3 Nov 2003 04:11:22 -0800, "****al" wrote: Is there any macro when i run it will take a backup of my excel file in c:\mydata folder. Thanks in Advance. ****al |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Auto Backup another folder | Excel Discussion (Misc queries) | |||
can I create backup file in separate folder from the original? | Setting up and Configuration of Excel | |||
save a backup copy in different folder | Excel Discussion (Misc queries) | |||
How do I Create backup of excel file in other folder | Excel Discussion (Misc queries) | |||
How do i save backup copy in a different folder | Excel Discussion (Misc queries) |