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 / Excel / Programming / March 2006

Tip: Looking for answers? Try searching our database.

Capturing errors in Macros using VB

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Priya - 23 Mar 2006 15:40 GMT
Hi,

I have an application written in VB which runs a particular macro in a few
Excel workbooks. Is there a way to capture the errors raised in the macro in
VB? Specifically, I dont want Excel or VBA to display any errors. All errors
must be transfered to the VB code calling the macro. (Err.Raise in the macro
just shows up a dialog with it going into the errorhandler of the calling VB
code.)

Thanks in advance!
Priya
MSweetG222 - 23 Mar 2006 16:46 GMT
Priya -

Try...

MyErrNum = Err.Number
MyErrDescr = Err.Description

This will store the Error # and Description in VBA memory variables.  You
can then write code to store to an excel worksheet if you wish.

Signature

Thx
MSweetG222

> Hi,
>
[quoted text clipped - 7 lines]
> Thanks in advance!
> Priya
MSweetG222 - 23 Mar 2006 16:48 GMT
Oops - Sorry, I just noticed you said VB, not VBA.  
Signature

Thx
MSweetG222

> Hi,
>
[quoted text clipped - 7 lines]
> Thanks in advance!
> Priya
 
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.