#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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default Userform

Ligaya,

disable the close button "x". i.e. makes it invisible.

Can't be done without an API call.
Best bet would be to look here
http://www.bmsltd.co.uk/Excel/Default.htm
for "FormFun.zip"
and you should be able to find the piece of code necessary to do what
you want.

John

Ligaya wrote:

John,

Thanks. Your VB works. However, what I really want to do
is disable the close button "x". i.e. makes it invisible.
Any ideas?

Ligaya
-----Original Message-----
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


.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Userform

John,

Thanks. I'll try that.

Ligaya
-----Original Message-----
Ligaya,

disable the close button "x". i.e. makes it invisible.

Can't be done without an API call.
Best bet would be to look here
http://www.bmsltd.co.uk/Excel/Default.htm
for "FormFun.zip"
and you should be able to find the piece of code necessary

to do what
you want.

John

Ligaya wrote:

John,

Thanks. Your VB works. However, what I really want to do
is disable the close button "x". i.e. makes it invisible.
Any ideas?

Ligaya
-----Original Message-----
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

.


.

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
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 08:26 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"