Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Capturing errors in Macros using VB

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default Capturing errors in Macros using VB

Oops - Sorry, I just noticed you said VB, not VBA.
--
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



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
Want to run two macros without errors daidipya Excel Discussion (Misc queries) 3 June 2nd 06 08:51 AM
Is it possible to turn off errors in macros??? sungen99[_64_] Excel Programming 4 January 27th 06 03:27 PM
macros errors Natalie Excel Worksheet Functions 5 March 14th 05 02:27 PM
Capturing query table errors T. Erkson Excel Programming 3 February 28th 05 05:26 PM
Capturing query table errors T. Erkson Excel Worksheet Functions 1 February 24th 05 09:26 PM


All times are GMT +1. The time now is 11:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"