Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / December 2007

Tip: Looking for answers? Try searching our database.

Disable the Close button on a Userform

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Moh - 14 Dec 2007 13:51 GMT
how do i disable the close button on my userform?
or can i just remove it?

and when the user clicks cancel... is there a way to direct the user back to
sheet1 ?

Cheers
--
Carim - 14 Dec 2007 14:19 GMT
Hi,

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As
Integer)
   If CloseMode = vbFormControlMenu Then
   ' make user do what you want"
   Cancel = True
   End If
End Sub

HTH
Moh - 14 Dec 2007 14:32 GMT
where do i put this code?
Signature


> Hi,
>
[quoted text clipped - 7 lines]
>
> HTH
paul.robinson@it-tallaght.ie - 14 Dec 2007 15:30 GMT
> where do i put this code?
> --
[quoted text clipped - 12 lines]
>
> - Show quoted text -

Hi
Double click your form and paste it in  (the code module behind the
form)
regards
Paul
Moh - 14 Dec 2007 15:47 GMT
it doesn't work

pls help further
Signature


> > where do i put this code?
> > --
[quoted text clipped - 18 lines]
> regards
> Paul
merjet - 14 Dec 2007 17:11 GMT
What exactly do you mean by "it doesn't work"?

Maybe you need to add a Command Button with
the following code:

Private Sub CommandButton1_Click()
Sheet1.Activate
Unload Me
End Sub
Carim - 14 Dec 2007 15:38 GMT
Open your form, hit F7 and copy code ...
merjet - 14 Dec 2007 15:40 GMT
> where do i put this code?

In the UserForm's code module.

Hth,
Merjet
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.