Capturing Errors in Macros using VB

  • Thread starter Thread starter Priya
  • Start date Start date
P

Priya

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
 
You could make that Excel macro a function, handle the error in that
function
and pass the error to VB as a result of that function. Haven't tried it but
I think
you could pass the Err object from the Excel function to VB.
Then you can do whatever you want with this in VB.

RBS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top