+ Reply to Thread
Results 1 to 7 of 7

Keep original file open after saving modified copy

  1. #1
    Registered User
    Join Date
    10-16-2013
    Location
    Charlotte, NC
    MS-Off Ver
    Office 365
    Posts
    17

    Post Keep original file open after saving modified copy

    I am not a VBA expert. I learned by trial and error and from "Google" university and this fine Forum.

    I have a file that is used every month. It is linked to 6 disparate data source files which change every month. The file harvests selected data from them, modifies, and reformats it into our preferred client report.

    After running the harvesting for one client against the data files, I currently have a macro that performs some modification (Copy and Paste as Values, Break Links, Select tabs to be included in modified file, etc.) against the file.

    Currently that macro ends by saving the modified file which checks for separate folder presence, creates if not present, and checks for Year sub folder, and creates if not present, and saves modified file.

    The way the macro is programmed, I currently close the modified file manually, and then reopen the original file, select the next client from a pull-down list, and repeat the modify macro, then manual close, and open process.

    I used to have some code that created the modified the file, and saved it, without changing or closing the original file. I don't seem to find it and I can't find what I need online.

    What would the best way to change this the modification macro to save the file using the same check folder and naming convention in the macro, but without having to close the modified file and then reopen the original file?

    Here is the check folder and naming convention part of the modification macro... sorry I did NOT find the Vbcode button mentioned in the help area....

    Please Login or Register  to view this content.
    Thank for your input and suggestions.
    Bob
    Last edited by AliGW; 07-16-2024 at 04:12 AM. Reason: Code tags added - please review the forum guidelines.

  2. #2
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,438

    Re: Keep original file open after saving modified copy

    At the end of the Check_Folder_Save_File_In_Year_Folder procedure add:
    Please Login or Register  to view this content.
    Also add the following procedure:
    Please Login or Register  to view this content.
    Artik
    Last edited by Artik; 07-16-2024 at 04:39 AM.

  3. #3
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,484

    Re: Keep original file open after saving modified copy

    and reformats it into our preferred client report.
    select the next client from a pull-down list, and repeat the modify macro,
    I used to have some code that created the modified the file, and saved it, without changing or closing the original file.
    This tells me that you need to change your code...I suggest a loop through those selections and then making use of similar code to what you lost to create your reports...keeping your main workbook open and saving created copies to the folders...
    Not sure of your setup as no sample file...Perhaps you can upload a sample file explaining your required steps and I'm am very certain someone will create the correct solution...
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2501 (Windows 11 24H2 64-bit)
    Posts
    89,067

    Re: Keep original file open after saving modified copy

    @ shepardrf

    I've added the code tags for you - click on Edit Post to see how I did that.

    Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Guideline #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  5. #5
    Registered User
    Join Date
    10-16-2013
    Location
    Charlotte, NC
    MS-Off Ver
    Office 365
    Posts
    17

    Re: Keep original file open after saving modified copy

    Thank you very much. I will spend some time with it and revert.
    Bob

  6. #6
    Registered User
    Join Date
    10-16-2013
    Location
    Charlotte, NC
    MS-Off Ver
    Office 365
    Posts
    17

    Re: Keep original file open after saving modified copy

    Thank you. Sorry for my fail.... this is the part I did not see in instructions when I was looking for it.... "click the # button in the edit controls".
    Bob

  7. #7
    Registered User
    Join Date
    10-16-2013
    Location
    Charlotte, NC
    MS-Off Ver
    Office 365
    Posts
    17

    Re: Keep original file open after saving modified copy

    Worked perfectly!
    Bob

+ 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. [SOLVED] Save Copy As - Leave original file open
    By NewYears1978 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-19-2022, 09:59 PM
  2. macro to save temporary copy if original file is open
    By thoandros in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-03-2020, 05:48 AM
  3. How to check Last Modified Date on Temp File and compare it to original/parent file?
    By CaffeinatedCoder in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-23-2016, 07:42 PM
  4. Keeping file open and saving a copy
    By Coleman34 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-16-2016, 08:24 PM
  5. Save file as copy while still having original still open
    By djblois1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-12-2013, 03:40 PM
  6. creating a copy of a file but not saving original
    By Mattneedshelp in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-07-2013, 05:29 AM
  7. Copy an open file and close the original
    By lancaster in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-01-2009, 10:03 AM

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