Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This code sort of does what the OP asked, but not what the user wants to do.
Telling him that the button doesn't work, or to use the close button, is a usability inefficiency (not to mention a PITA). You should make the X button close the form as if the user canceled it, since that's what he obviously wanted to do. The following assumes there is a button called btnCancel which gracefully closes the form and resets the application: Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) If CloseMode = vbFormControlMenu Then Cancel = True btnCancel End If End Sub - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - http://PeltierTech.com _______ "Mike H" wrote in message ... Hi, I'm not aware of a way to remove it and will be interested to see if you get a response but you can disable it. Right click on the userform, view code and paste this in:- Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) If CloseMode = vbFormControlMenu Then Cancel = True MsgBox "That button doesn't work" End If End Sub Mike "NateBuckley" wrote: Hello I'm just wondering if anyone can help me with the following question: I have multiple user forms for which on some I wish to remove the X button at the top that closes the form. I'm guessing I'll have to use the windows API for this? I've only just started learning the fundementals of Windows API Calls, and thus I'm a little stuck. I'm just wondering what I would have to do, to do this, my user form's name is "frm_Mod_Gen_CEmp" Thanks in advance for any help. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Form Buttons Connected to a Macro - Want to remove the button | Excel Worksheet Functions | |||
User form and Command button | Excel Discussion (Misc queries) | |||
User form x button | Excel Programming | |||
Button to call a user form? | Excel Programming | |||
A "previous" button on a user form | Excel Discussion (Misc queries) |