Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Backup file in folder

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Backup file in folder

****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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Backup file in folder

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 176
Default Backup file in folder

****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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Backup file in folder

****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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto Backup another folder Shakeel Excel Discussion (Misc queries) 0 May 26th 08 06:44 AM
can I create backup file in separate folder from the original? MCC Wong Setting up and Configuration of Excel 9 January 19th 08 01:06 AM
save a backup copy in different folder GT Excel Discussion (Misc queries) 3 May 11th 06 07:36 PM
How do I Create backup of excel file in other folder khalid Excel Discussion (Misc queries) 1 May 24th 05 11:01 AM
How do i save backup copy in a different folder mekraj Excel Discussion (Misc queries) 3 December 17th 04 08:33 PM


All times are GMT +1. The time now is 11:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"