+ Reply to Thread
Results 1 to 2 of 2

Closing the workbook without saving

Hybrid View

  1. #1
    Registered User
    Join Date
    03-30-2008
    Posts
    32

    Closing the workbook without saving

    Hi All,

    When a user clicks close icon the excel should close without throwing message "DO You want to save changes" and without saving the changes.
    I tried varoius things like display alerts, enable event, savechanges = false, but nothing seems to be working. Probably the place i am placing it is wrong.
    Currently i tried by putting the above in beforeclose, window deactivate events.
    Any Idea where i might be wrong.

    Regards,
    Tushar

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good morning tushar@excel

    Use this in the ThisWorkbook module. It basically tells excel that the file is saved, even if it isn't, so no message is generated :
    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    ActiveWorkbook.Saved = True
    End Sub
    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

+ 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. automatically save a copy of the workbook when saving or closing it
    By excel1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-17-2008, 08:06 AM
  2. Closing inactive workbook - without saving
    By ballgame in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-06-2008, 02:27 PM
  3. Closing the workbook & saving automatically
    By mwc0914 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-25-2008, 06:18 PM
  4. Closing Workbook without saving Changes
    By Sam I Am in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-10-2008, 08:02 PM
  5. closing a workbook without saving and closing a workbook with saving enabled
    By stanigator in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-24-2007, 02:15 PM

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