LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default Userform

Ligaya,

Place this code in the UserForm:

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

' Disable the "X" on the userform so that the user can't
' dismiss the userform by clicking on the "X" in the upper
' right hand corner of the userform
If CloseMode = vbFormControlMenu Then
Cancel = True
MsgBox Prompt:="Please use the buttons on the" & vbCrLf & _
" Form to Close it"
End If
End Sub

Note that the user could still use Ctrl + Break to get rid of
the form (and stop your macros)

John

Ligaya wrote:

I am developing a user form in which I do not want the
close (x) button. When I insert a new userform, this x
button is already there. Is there a way I could disable
this close button? Really appreciate if any one there
could help me.

Thanks.

Ligaya


 
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
VBA userform jcheko Excel Worksheet Functions 1 April 24th 08 08:38 PM
userform carwincarber New Users to Excel 0 October 23rd 05 06:59 PM
Userform Help in VBC Marcia3641 Excel Discussion (Misc queries) 1 July 23rd 05 12:10 AM
UserForm Help Jennifer Excel Discussion (Misc queries) 1 April 6th 05 10:57 AM
UserForm Gabriel[_2_] Excel Programming 0 July 28th 03 04:40 PM


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