Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Canceling a UserForm

How can I capture the event (if there is one) of a user
clicking the "X" at the upper right of a UserForm? I want
my workbook to save when this happens. It's driving me
crazy!!! Help!!!

Eric W.
Madison, WI
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default Canceling a UserForm

"Eric W." wrote in message
...
How can I capture the event (if there is one) of a user
clicking the "X" at the upper right of a UserForm? I want
my workbook to save when this happens. It's driving me
crazy!!! Help!!!


Hi Eric,

When the user clicks the X close button on a UserForm the UserForm's
QueryClose event is fired.

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
''' User clicked the X close button.
End If
End Sub

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *


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
canceling simplifying my fractions HI New Users to Excel 1 July 5th 21 12:47 PM
Self canceling checkboxes Glenn Excel Discussion (Misc queries) 3 October 28th 08 03:11 PM
canceling of automatic predicative writing kostistlac Excel Discussion (Misc queries) 1 October 8th 07 04:25 PM
canceling auto date update unexceller New Users to Excel 1 June 8th 06 07:40 AM
Canceling a Macro that Has Been Scheduled Murray Williams Excel Programming 2 July 25th 03 11:28 PM


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