+ Reply to Thread
Results 1 to 4 of 4

macro to close file and not save changes

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Birmingham, UK
    MS-Off Ver
    2007
    Posts
    185

    macro to close file and not save changes

    Hello All,

    I am using a spreadsheet that opens during a macro run and I wonder if I can do so and chose don't save without the window to pop out?

    Is there a possibility?
    ...and this is when I walk in, dressed fully in white...

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

    Re: macro to close file and not save changes

    Not sure what you mean but this suppresses the save window...
    Application.DisplayAlerts = False
    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!!!

  3. #3
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Birmingham, UK
    MS-Off Ver
    2007
    Posts
    185

    Re: macro to close file and not save changes

    Hi,

    Thank you for the suggestion.

    I have wrapped it around with:

    Application.DisplayAlerts = False
    and
    Application.DisplayAlerts = True
    to see it working as I wanted it.

    Thank you.

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,291

    Re: macro to close file and not save changes

    Something like this maybe.

        Application.DisplayAlerts = False
        Workbooks("yourworkbookname").Close False
        Application.DisplayAlerts = True
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

+ 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] Macro to open Excel file, run other macros save, and close file & repeat.
    By Ronnet2 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-08-2015, 09:47 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. [SOLVED] A macro to save and close the file at a pre-defined time
    By BNCOXUK in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-31-2013, 01:34 AM
  4. Replies: 1
    Last Post: 10-25-2013, 06:10 PM
  5. Macro to Open a file, transfer data, save and close
    By tforbes75 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-01-2011, 11:59 AM
  6. [SOLVED] CLOSE ALL macro for XL2K (but with prompt to save for each file)?
    By StargateFan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-10-2005, 10:05 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