LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Accidentally close user form_how to open


Hammer1947 Wrote:
Thanks Leith,
I don't want to have to Alt F8 to display the form. The form needs t
be
loaded and visible at all times while the excel program is running. Th
only
thing I was concerned about was the close "X". If I accidentally clic
the
close "X" the form goes away and I can't get it back. Ideally would b
to get
rid of the "X" button since I never want to close it during the runnin
of
the program. This form has buttons on it that are always used durin
the
program.

gary


from: http://www.contextures.com/xlUserForm01.html

To prevent users from closing the form by clicking the X button:

1. Right-click on an empty part of the UserForm
2. Choose View | Code
3. Scroll to the bottom of the existing code, and enter th
following code:

Private Sub UserForm_QueryClose(Cancel As Integer, _
CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
Cancel = True
MsgBox "Please use the button!"
End If
End Sub

4. On the Menu bar, choose View | Object, to return to th
UserForm.



--
MDubbelboe
-----------------------------------------------------------------------
MDubbelboer's Profile: http://www.excelforum.com/member.php...fo&userid=3633
View this thread: http://www.excelforum.com/showthread.php?threadid=56233

 
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
Close User Form Gazz_85[_2_] Excel Discussion (Misc queries) 1 July 8th 09 10:38 AM
How was user able to (accidentally) change an unlocked cell to loc J-Bo Excel Worksheet Functions 1 March 25th 08 05:12 PM
Macro to Prompt User to Close After Saving Rutabaga Excel Discussion (Misc queries) 2 July 12th 07 12:38 AM
close user form ViestaWu Excel Programming 5 July 14th 06 02:53 PM
Open Only the User Form ... or Close Everything ! monir Excel Programming 4 April 2nd 06 09:30 PM


All times are GMT +1. The time now is 06:07 PM.

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"