Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 280
Default REPOST: How to handle errors

Can you make sense of this example?

Sub Main()
Dim blnDialogClosed As Boolean
On Error GoTo ErrHandler

Retry:
If Not blnDialogClosed Then
Err.Raise -659537915
End If
MsgBox "Success"

Exit Sub
ErrHandler:

If Err.Number = -659537915 Then
MsgBox "You have a dialog box open, please close it and then retry"
blnDialogClosed = True 'just for example, equiv to closing dialog
Resume Retry
End If

' MsgBox "Number: " & Err.Number & vbNewLine & _
' "Description: " & Err.Description & vbNewLine & _
' "Source: " & Err.Source

End Sub



--
Bob Kilmer

"Bruccce" wrote in message
news:WbSXa.71532$uu5.7694@sccrnsc04...
I have a userform that I use.
I have it sending emails (works very well thanks to all of you in this
group).
The problem I have is that if I have a dialog box open (example, I have a
contact open, of msmessanger is asking me to log in) I get an error: The
error is
"Run-time error '-659537915 (d8b04005)':
A dialog box is open. Close it and try again.
[end] [debug] [help]
and then when I press any button, the form closes.

what I would like to happen, is if this error occurs, I would get a text

box
saying, "You have a dialog box open, please close it and then retry" and
then it would allow me to retry sending the email -after I close the
offending box-, or when I press a [retry] button, it would automatically

try
to resend. I would like this to happen without closing out the form.

How can I trap and process error messages?

Thanks
Bruce




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
what is "fill handle". i don't see any fill handle in my excel Neelakanta New Users to Excel 32 June 18th 08 12:48 PM
Repost for Ron Jenny B. Excel Discussion (Misc queries) 1 May 21st 08 09:39 AM
Fill handle turned into a move handle Northwoods Excel Discussion (Misc queries) 1 March 2nd 07 03:40 PM
Excel Throwing Circular Errors When No Errors Exist MDW Excel Worksheet Functions 1 August 10th 06 02:15 PM
Unresolved Errors in IF Statements - Errors do not show in results Markthepain Excel Worksheet Functions 2 December 3rd 04 08:49 AM


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