Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Make a user form 'un-closeable'

So now that I figured out how to work underneath a user form - how can
make the box uncloseable?

i.e. Everytime you try to click the 'x' - it displays cannot close

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Make a user form 'un-closeable'

Ok,

Now you have to add "Done" Button if you want to get rid of th
userform othewise it will always be there. But here is something tha
will cancel the "X". The "X" will still show but when clicked it wil
not close the form.

Heres the code for it.

Private Sub CommandButton1_Click()
Unload Me
End Sub

Private Sub UserForm_QueryClose(Cancel As Integer, closemode A
Integer)
If closemode = vbFormControlMenu Then
Cancel = True
End If
End Sub

HTH

Charle

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Make a user form 'un-closeable'

Thanks again man. Excatly what I was looking for

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Make a user form 'un-closeable'

Happy to Help

Charles


---
Message posted from http://www.ExcelForum.com/

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default Make a user form 'un-closeable'

Insert the following in your form code:

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
Dim vbResponse As VbMsgBoxResult
vbResponse = MsgBox("Do you want to close this form?", vbYesNo)
If vbResponse = vbNo Then Cancel = True
End Sub

Regards,
Andrew

peekbo wrote in message ...
So now that I figured out how to work underneath a user form - how can i
make the box uncloseable?

i.e. Everytime you try to click the 'x' - it displays cannot close.


---
Message posted from http://www.ExcelForum.com/



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
How do I fill a cell in a user form from a selection on same form? Terry Tipsy Excel Discussion (Misc queries) 4 June 11th 07 02:59 PM
User form JonathanW Excel Discussion (Misc queries) 1 May 2nd 07 07:50 AM
how can I make a form number change everytime the form is opened babydumplingspita Excel Worksheet Functions 1 October 10th 05 07:58 PM
How to: Make user click End User License Agreement acceptance jasonsweeney[_21_] Excel Programming 7 January 30th 04 01:41 AM
I am looking to see if anybody has an equivalant user form to Outlooks CONTACT form BruceJ[_2_] Excel Programming 2 October 15th 03 05:28 PM


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