+ Reply to Thread
Results 1 to 5 of 5

Move the existing (opened) workbook to a new folder location

  1. #1
    Forum Contributor
    Join Date
    08-24-2012
    Location
    Hollidaysburg, Pa
    MS-Off Ver
    Excel 2010
    Posts
    398

    Move the existing (opened) workbook to a new folder location

    Hello,

    Is it possible to move an open workbook to a new folder location ?

    I am currently using

    Please Login or Register  to view this content.
    However, with that there exists two copies of the same workbook. I want to avoid that . I would be referencing just the copy from C:\Subbby\Subbby Dance\Trial\

    Therefore, is there a way to do this ? something like

    I have a workbook open and I want a code to
    1. find the current workbook's location,
    2. copy this same workbook in a predefined location (C:\Subbby\Subbby Dance\Trial\) and
    3. then go back to original file and delete it ?
    Last edited by subbby; 11-16-2016 at 04:21 PM. Reason: Solved

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Move the existing (opened) workbook to a new folder location

    Quote Originally Posted by subbby View Post
    I have a workbook open and I want a code to
    1. find the current workbook's location,
    2. copy this same workbook in a predefined location (C:\Subbby\Subbby Dance\Trial\) and
    3. then go back to original file and delete it ?
    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    08-24-2012
    Location
    Hollidaysburg, Pa
    MS-Off Ver
    Excel 2010
    Posts
    398

    Re: Move the existing (opened) workbook to a new folder location

    Quote Originally Posted by AlphaFrog View Post
    Please Login or Register  to view this content.
    Worked well.. did what I want...



    Added reputations stars.

    Just one question, this macro is works when a command button on source file is clicked. Its doing all this while the workbook is still open .
    So which workbook am i looking at ? The newly copied /moved or the source file.

    My assumption is that I am looking at the new one because the command "Kill strFile" deletes it

    Correct me if I am wrong ?

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Move the existing (opened) workbook to a new folder location

    Correct; you're using the new copy after the macro is run.

    SaveAs creates a new copy and closes the original. Once the original is closed, it's killed.

    Please Login or Register  to view this content.
    FYI: .SaveCopyAs saves a copy of the workbook but the original workbook remains opened and the copy is closed.
    Last edited by AlphaFrog; 11-16-2016 at 04:32 PM.

  5. #5
    Forum Contributor
    Join Date
    08-24-2012
    Location
    Hollidaysburg, Pa
    MS-Off Ver
    Excel 2010
    Posts
    398

    Re: Move the existing (opened) workbook to a new folder location

    thank you !

    much appreciated

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA code to move workbook from one location to another
    By Stevo56 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-05-2014, 11:19 AM
  2. Tweak VBA to Move SharePoint Files to a Folder in Same Location
    By n_lindsey in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-13-2014, 03:21 PM
  3. create new folder at one location and copy photos in that folder from other location
    By meer_ali in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-22-2014, 05:20 AM
  4. Call a specific workbook from a file location and move worksheet to different workbook
    By dwhite30518 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-30-2014, 01:46 AM
  5. VBA: Save workbook in same folder where it is opened.
    By sroysroy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-09-2013, 11:51 PM
  6. [SOLVED] VBA Code open files in folder, copy text to workbook-Next time folder opened copy only new
    By Bikeman in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-02-2013, 07:59 PM
  7. How to add existing sheet to an opened workbook?
    By hegisin in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-20-2007, 04:21 AM

Tags for this Thread

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