View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
MSweetG222 MSweetG222 is offline
external usenet poster
 
Posts: 158
Default Capturing errors in Macros using VB

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.

--
Thx
MSweetG222



"Priya" wrote:

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