+ Reply to Thread
Results 1 to 3 of 3

code to save the whole folder with a workbook

  1. #1
    Tim
    Guest

    code to save the whole folder with a workbook

    Hi All

    Is it possible to change this code:
    Sub SaveBackup()
    ActiveWorkbook.SaveCopyAs "d:\MyBook.xls"
    End Sub
    to save a copy of the Folder in which is the Book-to back up not only
    MyBook but the whole current folder with the book?


  2. #2
    Chris
    Guest

    Re: code to save the whole folder with a workbook

    Tim,

    If your source and destination folders are fixed, then it is simple.
    The code below will do that. For extra options you can look in your
    command box and type "xcopy /?"

    ChDrive C:
    ChDir "c:\test\"
    Myapp = Shell("cmd /c xcopy c:\test d:\test", vbNormalFocus)

    If you want to keep your dos box open after proces you can use the "cmd
    /k" option this can be handy when an error occur.

    Chris


  3. #3
    Tim
    Guest

    Re: code to save the whole folder with a workbook



    Thak you Chris !!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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