Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Copy a workbook

I need to automate the copy of a workbook.? I have an Excel
spreadsheet located at C:\Reports\Test.xls, I need to copy it to
D:\BackUpReports\

What is the best way to do this.

With thanks

Bob


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Copy a workbook

Use ActiveWorkbook.SaveCopyAs ... which will save a backup copy for you.

You can put the code in one of the following sub:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
' if you want save a backup copy before close the file
End Sub

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
' if you want save a backup copy before any saving action
End Sub

Private Sub Workbook_Open()
' if you want save a backup copy before file open
End Sub



"Robert Gillard" wrote in message
k...
I need to automate the copy of a workbook.? I have an Excel
spreadsheet located at C:\Reports\Test.xls, I need to copy it to
D:\BackUpReports\

What is the best way to do this.

With thanks

Bob



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Copy a workbook

Hi Bob

From an external macro, something like

Sub test()
FileCopy "C:\temp\song.mp3", "D:\Anthems\song.mp3"
End Sub

from a macro within the file itself, something like

Sub test2()
ThisWorkbook.SaveCopyAs "D:\Anthems\" & ThisWorkbook.Name
End Sub

HTH. Best wishes Harald

"Robert Gillard" skrev i melding
k...
I need to automate the copy of a workbook.? I have an Excel
spreadsheet located at C:\Reports\Test.xls, I need to copy it to
D:\BackUpReports\

What is the best way to do this.

With thanks

Bob




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
Macro to copy an image (or picture) from one workbook to a new sheetin another workbook Ruchir Excel Worksheet Functions 1 July 25th 08 07:29 AM
Excel-how to link source workbook to copy of destination workbook D Lynn Excel Worksheet Functions 1 May 29th 08 05:36 PM
Copy cells based on conditions in one workbook to another workbook fLiPMoD£ Excel Discussion (Misc queries) 0 August 1st 07 07:43 PM
Copy cells based on conditions in one workbook to another workbook fLiPMoD£ Excel Worksheet Functions 0 August 1st 07 07:43 PM
Copy a range of cells in an unopened workbook and paste it to the current workbook topstar Excel Programming 3 June 24th 04 12:50 PM


All times are GMT +1. The time now is 01:56 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"