Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA Stack Trace Error Handling

Status
Not open for further replies.

Aidy680

Technical User
Nov 1, 2006
138
GB
We've been having a debate, which I'm wondering if anyone else has any views on. The crux of the argument is this:

Whether ot not the implementation of pseudo stack trace code (similar to that used in dot.net) into the VBA modules of library code, thus providing greater visibility as to what has been called, versus the additional risk that the introduction of an additional point of failure (new code modules to propogate the error back up to the original calling module), brings to the application.

Is it worth it? Aren't stack traces better suited to dot.net and classes? Would it save time debugging VBA apps?

Thoughts please.
 
a big distraction and time consumer. in an even moderatly large app, the "stack" would need to be quite large to implement a comprehensive trace. it would be a large task to implement the trace code in 'all' objects - and in all of the places where you might / would want it. many (human) decisions need to be carefully and fully reviewed before any real attempt.

would you include all (cimmand button) clicks? branches in code? combo box selections? form and report calls (including arguments)? ... ... ... each procedure?

I have done SOME of this, adding the necessary code to forms, reports and procedures programmatically. I chose to save the results in a simple text file as opposed to memory resident 'stacks'. mostly this decision we enforced by looking for what EXACTlY caused the app to crash, burn and explode.

enjoy

MichaelRed


 
Thanks Michael. I'm inclined to agree with you in terms of the amount of work involved and the total net benefit versus effort expended.

Also, what if the new 'string builder' routine fails? What's gonna catch that error? The same code that just failed??!!
 
Unfortunatly, there are gaps in the safety net of life. It is the reason acrobats practice [bold]A LOT[/bold]. For this 'exercise', I would perhaps equate the practicing part to small subsets Iand individual object of each (object) set. Testing the routine and the results carefully and expanding the test set in some rariuonal incerments. You mifgt also consider having routines to remove the trace code. ones to enable / disable the processes, options to delete an existing trace ...




MichaelRed


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top