Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Form Close Button


Hi,

Ive created a password form that activates on workbook open and i wan
to disble the red cross in the top right corner of the form or chang
the code to disble the form.

can this be done, please help


thank you all as always for your hel

--
ceem
-----------------------------------------------------------------------
ceemo's Profile: http://www.excelforum.com/member.php...fo&userid=1065
View this thread: http://www.excelforum.com/showthread.php?threadid=47559

  #2   Report Post  
Posted to microsoft.public.excel.programming
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
|


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 222
Default Form Close Button

Hi, take a look he- http://www.oaltd.co.uk/Excel/

"ceemo" wrote:


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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 222
Default Form Close Button

NoCloseButton.zip about 2/3rds down the page or perhape this code would help
(placed on your userform -

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)

' Prevents use of a Close/Cancel button
If CloseMode = vbFormControlMenu Then
MsgBox "Please select the CANCEL button.", , ""
Cancel = True
End If

End Sub


"bigwheel" wrote:

Hi, take a look he- http://www.oaltd.co.uk/Excel/

"ceemo" wrote:


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


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
close button does not close goplayoutside Excel Discussion (Misc queries) 1 October 11th 05 03:42 PM
Excel shoud not close all active books when clicking close button technomike Excel Discussion (Misc queries) 0 June 10th 05 05:35 PM
excel - Windows close button (x) should only close active workboo. CoffeeAdict Setting up and Configuration of Excel 3 February 8th 05 04:30 AM
Form Close button fran Excel Programming 2 September 16th 03 09:32 PM
SIMPLEST way to disable "close" button on form? codytheretriever Excel Programming 4 August 7th 03 09:00 PM


All times are GMT +1. The time now is 11:19 PM.

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"