Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Behind my user form I have a UserForm_QueryClose macro. This as I would
like people to confirm when they press the Escape key. I want them to realize they will be closing the form and not saving any changes to their input data. If I set the Cancel property on my cancel button to False, then the escape key is not allowed. If I set it to True, escape works, the UserForm_QueryClose macro is called, but I can't tell that an escape was pressed instead of the Cancel button being clicked. What I observe is when escape is pressed, or the done or cancel buttons are clicked (all are doing unloads), inside the macro Cancel=0 and CloseMode=1. If the X in the upper right of the form is clicked, Cancel=0 and CloseMode=0. Is there any other more useful information that can be accessed so I can do what I want? I suspect not. (When does Cancel=1?) Don <www.donwiss.com (e-mail link at home page bottom). |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
From help, the values for closemode
vbFormControlMenu 0 The user has chosen the Close command from the Control menu on the UserForm. vbFormCode 1 The Unload statement is invoked from code. vbAppWindows 2 The current Windows operating environment session is ending. vbAppTaskManager 3 The Windows Task Manager is closing the application. -- HTH RP (remove nothere from the email address if mailing direct) "Don Wiss" wrote in message ... Behind my user form I have a UserForm_QueryClose macro. This as I would like people to confirm when they press the Escape key. I want them to realize they will be closing the form and not saving any changes to their input data. If I set the Cancel property on my cancel button to False, then the escape key is not allowed. If I set it to True, escape works, the UserForm_QueryClose macro is called, but I can't tell that an escape was pressed instead of the Cancel button being clicked. What I observe is when escape is pressed, or the done or cancel buttons are clicked (all are doing unloads), inside the macro Cancel=0 and CloseMode=1. If the X in the upper right of the form is clicked, Cancel=0 and CloseMode=0. Is there any other more useful information that can be accessed so I can do what I want? I suspect not. (When does Cancel=1?) Don <www.donwiss.com (e-mail link at home page bottom). |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
BTW, Cancel is an argument that you determine the value (true or False)
depending upon whether you want to continue the Cancel or quit it. It should always enter False. -- HTH RP (remove nothere from the email address if mailing direct) "Don Wiss" wrote in message ... Behind my user form I have a UserForm_QueryClose macro. This as I would like people to confirm when they press the Escape key. I want them to realize they will be closing the form and not saving any changes to their input data. If I set the Cancel property on my cancel button to False, then the escape key is not allowed. If I set it to True, escape works, the UserForm_QueryClose macro is called, but I can't tell that an escape was pressed instead of the Cancel button being clicked. What I observe is when escape is pressed, or the done or cancel buttons are clicked (all are doing unloads), inside the macro Cancel=0 and CloseMode=1. If the X in the upper right of the form is clicked, Cancel=0 and CloseMode=0. Is there any other more useful information that can be accessed so I can do what I want? I suspect not. (When does Cancel=1?) Don <www.donwiss.com (e-mail link at home page bottom). |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Answers to questions posing more questions in a workbook | Excel Worksheet Functions | |||
View Questions and Answer to questions I created | Excel Discussion (Misc queries) | |||
A few questions please help! | New Users to Excel | |||
Two Questions | Excel Programming | |||
several questions | Excel Programming |