+ Reply to Thread
Results 1 to 4 of 4

Save/Closed only macro related files and leave unrelated files open in excel?

  1. #1
    Registered User
    Join Date
    10-31-2013
    Location
    Golden, CO
    MS-Off Ver
    Excel 2010
    Posts
    43

    Save/Closed only macro related files and leave unrelated files open in excel?

    I have a macro file that opens a raw data file located in an input folder on a shared drive, does some fancy macro stuf, then saves that same file out to an output folder (different location) on the shared drive. I dont not want to save or make any changes to the original macro and raw data file, only save changes to the file that is saved in the output folder. Im trying to use the macro to close only the macro and associated files and to leave any unrelated excel files open. The code below closes eveything in excel but saves everything as needed. Thoughts?


    Please Login or Register  to view this content.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,377

    Re: Save/Closed only macro related files and leave unrelated files open in excel?

    The workbook running the macros is ThisWorkbook so you can use ThisWorkbook.Close instead of Workbooks.Close


    Regards. TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    10-31-2013
    Location
    Golden, CO
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Save/Closed only macro related files and leave unrelated files open in excel?

    Issue solved. Thank you TMShucked for the quick and easy solution. It's people like you that make this board/site AWESOME!!

    Thanks,
    Ray

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,377

    Re: Save/Closed only macro related files and leave unrelated files open in excel?

    You're welcome.

+ 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. one folder & so many excel files are save, i want name change without open excel files
    By sonu_kumar444 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-14-2013, 03:45 PM
  2. macro should run with related files not with other excel files
    By bittu2010 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-16-2012, 05:25 PM
  3. Macro to Open, Save and Close Excel Files
    By az! in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-07-2011, 04:19 AM
  4. exce; macro to open, save embedded pdf, word, excel, ppt files to a folder
    By mcledavid in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-16-2009, 05:17 PM
  5. Replies: 2
    Last Post: 11-30-2005, 01:55 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