Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Disable close button on all froms & MsgBoxes

Is there a way to disable/hide/something the close buttons in all userforms
and msgboxes in a workbook? If not can you individually disable/hide them in
userforms? MsgBoxes?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default Disable close button on all froms & MsgBoxes

On user forms try...

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
Cancel = True
'Chg msg text to fit your needs...
MsgBox "Please use the ''OK'' Button.", vbInformation
End If
End Sub


--
Thx
MSweetG222



"Haxer" wrote:

Is there a way to disable/hide/something the close buttons in all userforms
and msgboxes in a workbook? If not can you individually disable/hide them in
userforms? MsgBoxes?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Disable close button on all froms & MsgBoxes

Thank you...
Do you know if there is a way to globalize this so that I can put it in once
and it will work for all userforms?

"MSweetG222" wrote:

On user forms try...

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
Cancel = True
'Chg msg text to fit your needs...
MsgBox "Please use the ''OK'' Button.", vbInformation
End If
End Sub


--
Thx
MSweetG222



"Haxer" wrote:

Is there a way to disable/hide/something the close buttons in all userforms
and msgboxes in a workbook? If not can you individually disable/hide them in
userforms? MsgBoxes?

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
Disable Close Button dan Excel Discussion (Misc queries) 5 September 22nd 06 07:39 PM
Disable the Close Window button of the worksheet yangyh[_7_] Excel Programming 0 September 14th 05 05:04 AM
How to disable a sheet's x(close) button? Stefi Excel Programming 4 May 6th 05 01:21 PM
Disable Close X Button On Excel Application Celtic_Avenger[_57_] Excel Programming 2 October 31st 04 04:02 PM
Disable close button of Modeless Userform RB Smissaert Excel Programming 2 September 13th 03 09:46 PM


All times are GMT +1. The time now is 01:50 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"