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 / Outlook / Programming Forms / April 2005

Tip: Looking for answers? Try searching our database.

Error Checking does nothing

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
lorenmcguire - 25 Apr 2005 19:48 GMT
I have put the following code in my vbscript to catch errors, but it does
absolutely nothing.  This is straight out of the book.... did I miss
something here?

Thanks

Dim strMessage
If Err.Number <> 0 Then
MsgBox "Well, That didn't Work"
strMessage = "The following error " & Err.Description & _
" has occurred in the " & Err.Source & " appliction. " & _
"The error number was " & Err.Number & ". " & _
"Please report this error to the help desk."

MsgBox strMessage,16,"Run-time Error #" & Err.Number

Exit Sub
End If
Eric Legault [MVP - Outlook] - 26 Apr 2005 02:26 GMT
Can you please provide some context?  Your code is fine, except that if there
is no error, code after the "If Err.Number <> 0 Then" line won't run.  So if
there are no errors, everything is fine!

--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
--------------------------------------------------
{Private e-mails ignored}
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/

> I have put the following code in my vbscript to catch errors, but it does
> absolutely nothing.  This is straight out of the book.... did I miss
[quoted text clipped - 14 lines]
> Exit Sub
> End If
 
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.