#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default Auto_Close

Hi,
Because my workbook does a lot of work before closing down, if someone was
to press Cancel on the Save dialogue box it really messes things up.
Is there a way in which maybe the Cancel can not be shown and be left with
the Yes and No instead?
Regards
John

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 324
Default Auto_Close

ThisWorkbook.Close (SaveChanges = True) ' will avoid the dialog box and thus
help prevent problems.

Best wishes,

Jim

"JohnUK" wrote:

Hi,
Because my workbook does a lot of work before closing down, if someone was
to press Cancel on the Save dialogue box it really messes things up.
Is there a way in which maybe the Cancel can not be shown and be left with
the Yes and No instead?
Regards
John

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default Auto_Close

Hi Jim,
After a bit of trying & testing I finaly got this to work.
Many thanks - Greatly Appreciated
Regards
John
PS I did try changing the True to False but for some reason that didnt want
to know

Msg = "Save changes to Workbook?"
Style = msoAlertButtonYesNo + vbCritical + vbDefaultButton1
Title = "SAVE WORKBOOK?"
Ctxt = 1000
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response = vbYes Then
ActiveWorkbook.Save
ThisWorkbook.Close (SaveChanges = True)
Else
ThisWorkbook.Close (SaveChanges = True)
End If

"Jim Jackson" wrote:

ThisWorkbook.Close (SaveChanges = True) ' will avoid the dialog box and thus
help prevent problems.

Best wishes,

Jim

"JohnUK" wrote:

Hi,
Because my workbook does a lot of work before closing down, if someone was
to press Cancel on the Save dialogue box it really messes things up.
Is there a way in which maybe the Cancel can not be shown and be left with
the Yes and No instead?
Regards
John

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto_Close() not running Steve Barnett Excel Programming 3 August 9th 05 09:03 AM
BeforeClose vs Auto_Close [email protected] Excel Programming 16 June 3rd 05 10:06 PM
Question about auto_close Neil[_20_] Excel Programming 3 July 7th 04 09:24 PM
Auto_Close() needs help Phil Hageman[_3_] Excel Programming 3 November 19th 03 05:56 PM
Auto_Close Luc Benninger Excel Programming 2 October 14th 03 12:34 PM


All times are GMT +1. The time now is 10:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"