+ Reply to Thread
Results 1 to 6 of 6

Save copy of file in other folder

  1. #1
    Registered User
    Join Date
    06-14-2012
    Location
    Brussels
    MS-Off Ver
    Excel 2010
    Posts
    16

    Save copy of file in other folder

    Hello everybody,

    I do have a file in which I have a macro that closes and saves the file, if the user is running the macro. The file is saved under the specified folder it is located. The code is as follows:

    Please Login or Register  to view this content.

    I would now like, apart from the above, which works fine, to also save a copy of that file in another location (another folder on my drive).
    Can the above macro also include a command to save a copy of this file in another location?

    Thank you

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Save copy of file in other folder

    Just add another SaveAs line:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-14-2012
    Location
    Brussels
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Save copy of file in other folder

    Thank you for your response.

    I am afraid, the above is somehow not working though. I change the pathname to the location I want to save in addition the copy of the file, but it is only saved to its original location. No copy is saved to the new path.

    Thank you

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Save copy of file in other folder

    It should work. Try putting it in the with statement.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-14-2012
    Location
    Brussels
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Save copy of file in other folder

    It seems like it is saving the file, but it changes the file name to the path that I am entering, in this case "C:\YOUR DESTINATION".

    I need it to save a copy of the file and keep the same file name. The saving should be done in another folder.

    Say, the name of the file is "MyFile"
    I want it to save "MyFile" in C:\All Files\Master
    and a copy of "MyFile" in C:\All Files\Project1
    The name "MyFile" should not be changed.

    thank you

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Save copy of file in other folder

    Try:

    Please Login or Register  to view this content.

+ 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