Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default How to desensitize the "X" on Inputboxs, Textboxes and other gui's

Good morning!

I find myself without my VBA bible, it is at work and I am at
home....in it was a method to desenitize the "X" found on various
boxes that can be build via VBA. To my horror I have found several
field type people (read that as users) who are using this 'X' and
blowing up my VBA utility.

Can some one offer the fix for this that I can't quite remember and
put me out of my misery?

Thanks

Wayne
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 152
Default How to desensitize the "X" on Inputboxs, Textboxes and other gui's

This might be too late for you, but here is code to stop the user from
closing with the "X". This is for a userform; you didn't mention if that was
the case or not.

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
Cancel = True
MsgBox "Please use the OK button." 'Change message to suite.
End If
End Sub


Alan



" wrote:

Good morning!

I find myself without my VBA bible, it is at work and I am at
home....in it was a method to desenitize the "X" found on various
boxes that can be build via VBA. To my horror I have found several
field type people (read that as users) who are using this 'X' and
blowing up my VBA utility.

Can some one offer the fix for this that I can't quite remember and
put me out of my misery?

Thanks

Wayne

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default How to desensitize the "X" on Inputboxs, Textboxes and other gui's

Maybe you've never thought of it, but this is a bad way to disable the red
X. Why chastise your user for using the red X to dismiss the form?

The technique I posted, and the approach Rick mentioned, both cause the red
X click to actually execute a click on the button you want the user to press
to dismiss the dialog.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"Alan" wrote in message
...
This might be too late for you, but here is code to stop the user from
closing with the "X". This is for a userform; you didn't mention if that
was
the case or not.

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
Cancel = True
MsgBox "Please use the OK button." 'Change message to suite.
End If
End Sub


Alan



" wrote:

Good morning!

I find myself without my VBA bible, it is at work and I am at
home....in it was a method to desenitize the "X" found on various
boxes that can be build via VBA. To my horror I have found several
field type people (read that as users) who are using this 'X' and
blowing up my VBA utility.

Can some one offer the fix for this that I can't quite remember and
put me out of my misery?

Thanks

Wayne



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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
Highlight / "Selection" of AutoShape Text (Like SelStart for TextBoxes) James Cox[_2_] Excel Programming 0 May 18th 05 06:05 PM


All times are GMT +1. The time now is 02:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"