+ Reply to Thread
Results 1 to 3 of 3

Once Save as method used, original File opens after every macro

  1. #1
    Registered User
    Join Date
    02-26-2020
    Location
    Boston
    MS-Off Ver
    MS Office 365
    Posts
    12

    Lightbulb Once Save as method used, original File opens after every macro

    I have a file that opens with 1 sheet visible. Some data is imported to the sheet and once the data is verified, there is a button to save the file with a very specific name and in a location by the user. Once the file saves there are other sheets that will become visible with new macros. When working in the original file everything works smoothly, however, once the file is in the new file name, all the macros open the original file. I have been able to put a line of code to close the file but I would prefer to understand why this is happening and fix the code. It seems that there are a lot of things happening in the background making the code less efficient and slow (the page blinks a lot). I have attached the Save As macro as well as another macro that is executed in the new file. I am no VBA expert so the help is appreciated.


    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by sambarrett215; 02-26-2020 at 08:04 PM.

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

    Re: Once Save as method used, original File opens after every macro

    Instead of copying the worksheets to a NEW workbook, just SaveAs the original workbook. That will keep the original file intact and your other macros should work properly on the SaveAs copy.

    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
    Registered User
    Join Date
    02-26-2020
    Location
    Boston
    MS-Off Ver
    MS Office 365
    Posts
    12

    Re: Once Save as method used, original File opens after every macro

    That worked! Thank you

+ 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. 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
  2. Script/macro to save a copy as tab delimited text file and then close original file
    By Merlin803 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-02-2015, 01:34 PM
  3. Need macro that opens .txt file in excel, run macros and save file in batch
    By khalidness in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-11-2014, 11:00 AM
  4. Replies: 1
    Last Post: 09-05-2013, 02:39 PM
  5. [SOLVED] Problem to re-open original file after save as macro has run
    By Luli in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-28-2012, 01:08 PM
  6. Macro to keep original file open, not 'save as' file
    By LonestarGuy in forum Excel General
    Replies: 4
    Last Post: 06-09-2010, 03:53 PM

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