Results 1 to 5 of 5

Save backup to different directory

Threaded View

  1. #1
    Forum Contributor
    Join Date
    08-04-2008
    Location
    West Calder, Scotland
    MS-Off Ver
    365
    Posts
    430

    Save backup to different directory

    Good Morning All

    Been wrestling with an issue for past couple of hours with no joy....

    I have a file on the C Drive.... At the beginning of each week the file name is changed with the name in "Sheet 1, Cell A3". Week 1,, Week 2, Week 3, etc.. The macro for changing the name and saving it on the C Drive works as it should.......

    At the end of the week I also need this file to be backed up onto a different drive with its new name, in this case Drive 'H',

    as an example; this week it would be saving Week 1.... then at the end of the week the user presses the button to make a backup of week 1, next week it would be saving Week 2 and making a backup of Week 2 etc

    this is where I am running into problems. it will not save a backup copy.. this is the code I have been trying to use,,,

    many thanks for your help

    Jim

    Sub Save_Backup()
    ' Creates a backup on the H Drive
    
    Dim sFile As String
    Dim sSaveAs As String
    sSaveAs = Range("A3")
    
    On Error Resume Next
    Application.DisplayAlerts = False
    
    ActiveWorkbook.SaveAs Filename:="H:\Transport\DWR C Backup\" & sSaveAs
    sFile = "H:\Transport\DWR C Backup\" & sSaveAs
               
    Application.DisplayAlerts = True
    
    ThisWorkbook.Close SaveChanges:=True
        
    End Sub
    Last edited by JamesT1; 11-27-2021 at 08:16 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Backup in sub directory
    By Gerrit.B in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-31-2015, 01:09 AM
  2. Macro to Auto save a backup copy in a seperate location OR save file with a pop up
    By kdsanderson30 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-12-2014, 12:38 PM
  3. VBA code to change backup directory using Orlando’s XLtoEXE
    By newqueen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-22-2013, 08:27 PM
  4. Replies: 1
    Last Post: 04-19-2006, 11:30 AM
  5. [SOLVED] Backup:always create a backup file in the save options
    By Alek in forum Excel General
    Replies: 1
    Last Post: 01-07-2006, 09:25 PM
  6. [SOLVED] Backup files in separate directory?
    By Martyn B Tindall in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-30-2005, 08:10 PM
  7. Create a Backup in Different Directory
    By tkanasoot@yahoo.com in forum Excel General
    Replies: 1
    Last Post: 08-02-2005, 05:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1