Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default how to quit in BeforeClose

Hi.

(Excel 2010)
I need to check if the user has changed the name at the actual sheet
before the workbook is closed.

In my sub Workbook_BeforeClose(Cancel As Boolean)
I have a YesNo box. The intention is, that if the user select No the
workbook shall remain open, e.g. the sub shall not be executed.

How do I do ?

Regards

Peter

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,522
Default how to quit in BeforeClose

On Jul 14, 7:49*am, Peter wrote:
Hi.

(Excel 2010)
I need to check if the user has changed the name at the actual sheet
before the workbook is closed.

In my sub Workbook_BeforeClose(Cancel As Boolean)
I have a YesNo box. The intention is, that if the user select No the
workbook shall remain open, e.g. the sub shall not be executed.

How do I do ?

Regards

Peter


As ALWAYS, post your efforts for comments and suggestions.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default how to quit in BeforeClose

Hi.

I did find a way:


Sub Workbook_BeforeClose(Cancel As Boolean)

a = MsgBox("Fik du rettet navnet på det nye ark ?", vbYesNo)
If a = vbNo Then Cancel = True

end sub

Thank you

Peter
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default how to quit in BeforeClose

Peter expressed precisely :
Hi.

I did find a way:


Sub Workbook_BeforeClose(Cancel As Boolean)

a = MsgBox("Fik du rettet navnet på det nye ark ?", vbYesNo)
If a = vbNo Then Cancel = True

end sub

Thank you

Peter


Congratulations!!! That's exactly how it's done...

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


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
beforeclose Curt Excel Programming 1 August 16th 08 11:41 PM
EnableEvents BeforeClose Stefi Excel Programming 2 November 16th 05 09:22 AM
BeforeClose Problem [email protected] Excel Programming 1 October 6th 05 02:15 PM
vba advice how 2get a input box to quit by entering the word quit+ 4 a msgbox to disp RELWOD85[_4_] Excel Programming 3 August 1st 05 07:11 PM
BeforeClose vs Auto_Close [email protected] Excel Programming 16 June 3rd 05 10:06 PM


All times are GMT +1. The time now is 01:19 AM.

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

About Us

"It's about Microsoft Excel"