Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 89
Default Run Time Error on Closing UserForm

Hello,
I have a userform with a cancel button on it. If I select that button, the
program ends as it is supposed to. However, if I select the red X in the
upper right hand side, I get the following (which occurs at userform.hide):

Run Time Error '-2147418105 (800100007)'

Automation Error

The callee (server [not server application] is not available and
disappeared; all connections are invalid. The call may have executed.



Any ideas? I did had a button that calls another userform for information,
but then that is closed and it comes back to this one.



Thanks,



Bill


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Run Time Error on Closing UserForm


Hello Bill,

You can determine which close button was chosen and skip UserForm.Hide
if it was the window close button (red X). This information is made
available in the UserForm_QueryClose event.

Here is an example...


Code:
--------------------

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

If CloseMode = 0 Then Exit Sub 'Red X was clicked
UserForm1.Hide

End Sub

--------------------


If the user clicks your close button, CloseMode will equal 1.

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=561736

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
Run time error on Userform Show DonF Excel Programming 2 November 23rd 05 09:56 PM
Closing UserForm Keri Excel Programming 3 October 25th 05 07:31 PM
closing a userform mangesh_yadav[_50_] Excel Programming 5 August 31st 04 02:26 PM
Vba - automaticaly closing userform ajliaks[_30_] Excel Programming 1 August 22nd 04 09:53 AM
Help with closing a UserForm Ron de Bruin Excel Programming 0 August 8th 03 01:52 PM


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