Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Close X button on Usser Form
Hi Gentleman.
I have a form that has the blue title bar along with the "X" in the upper right corner. I am having trouble finding the code or process of eliminating the "X" so the user will have only once choice to close the form through the Close button created in the form. Any suggestions would be highly appriciated to get be through this hurdle. Thanks! -- SBR |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Close X button on Usser Form
Here's a better way. The user wants to close the form, so let them close the
form using either the close button or the big X in the corner. When they click the X, you simply want to cancel the normal behavior of the X and run the close button code. Put this procedure into your userform code module: Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) ' how was the form closed? vbFormControlMenu = X in corner of title bar If CloseMode = vbFormControlMenu Then ' cancel normal X button behavior Cancel = True ' run code for click of Close/Cancel button btnCancel_Click End If End Sub - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - http://PeltierTech.com _______ "Scardona Bay Viktor" wrote in message ... Hi Gentleman. I have a form that has the blue title bar along with the "X" in the upper right corner. I am having trouble finding the code or process of eliminating the "X" so the user will have only once choice to close the form through the Close button created in the form. Any suggestions would be highly appriciated to get be through this hurdle. Thanks! -- SBR |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Close user form when button is pressed | Excel Programming | |||
Form Close Button | Excel Programming | |||
Excel shoud not close all active books when clicking close button | Excel Discussion (Misc queries) | |||
Form Close button | Excel Programming | |||
SIMPLEST way to disable "close" button on form? | Excel Programming |