+ Reply to Thread
Results 1 to 4 of 4

Copying workbooks to another folder

Hybrid View

F6Hawk Copying workbooks to another... 06-05-2007, 07:29 PM
Steel Monkey Copying workbooks to another... 06-05-2007, 08:12 PM
F6Hawk I am not sure how this... 06-05-2007, 08:28 PM
Steel Monkey Copying workbooks to another... 06-05-2007, 08:34 PM
  1. #1
    Forum Contributor
    Join Date
    02-20-2007
    Location
    Alaska
    MS-Off Ver
    2003, 2007, 2010
    Posts
    105

    Copying workbooks to another folder

    I have a sheet that runs sever reports via macros, opening and closing about 6 different workbooks, saving the results on the hard drive.

    Is there a way to copy the different workbooks to a different device (backup) during the macro execution? I don't want to SAVEAS, but preferably copy, so the files aren't later opened from the improper folder.

    I know I could do this using a batch file to copy files, but would prefer to copy them using my macro.

    TIA!

  2. #2
    Forum Contributor
    Join Date
    11-23-2005
    Location
    Perth, Australia
    Posts
    218

    Copying workbooks to another folder

    I may be missing the point here, but could you use 'savecopyas' from inside your macro ?

  3. #3
    Forum Contributor
    Join Date
    02-20-2007
    Location
    Alaska
    MS-Off Ver
    2003, 2007, 2010
    Posts
    105
    I am not sure how this command works (I am not very VBA savvy), but my goal is to have an original and a back up copy on a portable device.

    What I DON'T want to have happen is to go to File, select the name of the file I want to change, and inadvertently open the back up copy because the Save As command was used, and the last remembered location MAY be the back up one.

    Here's my current code for one of the files:
    ActiveWorkbook.SaveAs Filename:=Drive_Letter & "SDIRPTS\ARCCLOSEDWO.xls", FileFormat:= _
            xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
            , CreateBackup:=False
    If the "savecopyas" command will do this, then I would appreciate an example of how to use this code.

    Thanks!

    Quote Originally Posted by Steel Monkey
    I may be missing the point here, but could you use 'savecopyas' from inside your macro ?

  4. #4
    Forum Contributor
    Join Date
    11-23-2005
    Location
    Perth, Australia
    Posts
    218

    Copying workbooks to another folder

    Very simple to use, see below and change the filename to suit you.

    ActiveWorkbook.SaveCopyAs ("F:\test.xls")
    This should do what you require, have a fiddle around with it and let me know how you go

+ 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