Hi all, first time trying to tackle error handling to any real degree and I just wanted a few suggestions/tips. The below is the basic overview of my code for my errors. Not capturing them individually as of yet. I was wondering does the error handling carry propogate through called subs? Or do I need to include it in what's called too?
If so, do you guys actually add error handling to each individual sub or is there a better way to pick up the errors?
Overview of the code: My Menu has a series of buttons, which will call the following procedures (button_Phasex_Stepx), which will then inturn call the required subs within. phaseCompleted is purely for formatting on the cells' interiors where the buttons are (Green if it completes, Red if it fails, Blank to just reset it)
Any help/hints/trips would be great!
If so, do you guys actually add error handling to each individual sub or is there a better way to pick up the errors?
Overview of the code: My Menu has a series of buttons, which will call the following procedures (button_Phasex_Stepx), which will then inturn call the required subs within. phaseCompleted is purely for formatting on the cells' interiors where the buttons are (Green if it completes, Red if it fails, Blank to just reset it)
Code:
Sub button_Phase1_Step1
eHandling array("Macro1","Macro2"),1,1
End Sub
Sub button_Phase1_Step2
eHandling array("Macro3","Macro4","Macro5","Macro6"),1,2
End Sub
...
Sub eHandling(sSubs As Variant, iPhase As Integer, iStep As Integer)
Dim iSubs As Integer
On Error GoTo eHandle: phaseCompleted iPhase, iStep, psReset
For iSubs = LBound(sSubs) To UBound(sSubs)
Application.Run sSubs(iSubs)
Next iSubs
phaseCompleted iPhase, iStep, psCompleted
Exit Sub
eHandle: phaseCompleted iPhase, iStep, psFailed
End Sub
Any help/hints/trips would be great!