View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Rech Jim Rech is offline
external usenet poster
 
Posts: 2,718
Default Form Close Button

Just add this to your userform's code module:

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = 0 Then Cancel = 1
End Sub

When the X is clicked CloseMode is 0. But when you do an UnLoad Me
CloseMode will be 1 so the form will close.

--
Jim
"ceemo" wrote in
message ...
|
| Hi,
|
| Ive created a password form that activates on workbook open and i want
| to disble the red cross in the top right corner of the form or change
| the code to disble the form.
|
| can this be done, please help
|
|
| thank you all as always for your help
|
|
| --
| ceemo
| ------------------------------------------------------------------------
| ceemo's Profile:
http://www.excelforum.com/member.php...o&userid=10650
| View this thread: http://www.excelforum.com/showthread...hreadid=475594
|