+ Reply to Thread
Results 1 to 4 of 4

Why "do you want to save" messagebox prompted?

  1. #1
    Registered User
    Join Date
    11-29-2012
    Location
    Warsaw, poland
    MS-Off Ver
    Excel 2010
    Posts
    77

    Why "do you want to save" messagebox prompted?

    All,

    I have a question about preventing "Do you want to save" message box to prompt. Well, most cases are covered by workbook.saved property, however not the one when the user wants to switch off or restart pc when the file is open.

    Do you know any simple way of delaing with that?

    Thanks in advance.

    You can test the issue with a rather simple code (to be included ThisWorkbook module).

    Please Login or Register  to view this content.

  2. #2
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,819

    Re: Why "do you want to save" messagebox prompted?

    I have closed the many duplicates of this thread. Please post only one post per issue.
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    11-29-2012
    Location
    Warsaw, poland
    MS-Off Ver
    Excel 2010
    Posts
    77
    applogies for duplicates and mess on forum.

  4. #4
    Registered User
    Join Date
    11-29-2012
    Location
    Warsaw, poland
    MS-Off Ver
    Excel 2010
    Posts
    77

    Re: Why "do you want to save" messagebox prompted?

    OK, I solved the problem.
    For some reason when the PC is restarted the "beforeclose" event is not triggered. The solution is simple: to set ThisWorkbook.Saved to true and keeping it on all events like worksheet_change, worksheet_selectionchange and any other activities changing the file.

+ 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. How to select "yes" when prompted to check in sharepoint file using VBA
    By Spartangirl in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-19-2015, 12:32 PM
  2. Code only runs when a user hits "Save", not "Save As"
    By cjstewart8 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-04-2014, 07:41 PM
  3. [SOLVED] Script to save to folder in "v:\dept2", confirm file saved, then delete from "v:\dept1"
    By ks100 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-28-2014, 11:42 AM
  4. [SOLVED] Cancelling "Open" dialog box when prompted macro
    By DeRo22 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-09-2013, 01:17 PM
  5. Macro to select "Continue" when opening another file and prompted to update links
    By kwaldersen in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-25-2012, 11:57 AM
  6. Validation on clicking "Cancel" on messagebox.
    By excelit in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-02-2011, 08:32 AM
  7. Excel Sort Macro is just giving me a "400" messagebox!
    By gausie in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-26-2007, 06:32 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