keithkemble
Board Regular
- Joined
- Feb 15, 2002
- Messages
- 160
I have a routine that comprises several sub routines eg (in simple form):-
Sub cmrmenu()
On Error GoTo error
Application.ScreenUpdating = False
Dim SH As Worksheet
For Each SH In ThisWorkbook.Sheets
SH.Unprotect "password"
Application.ScreenUpdating = True
Sheets("menu").Select
Application.Run ("Cmr_Show_Please_Wait")
Application.ScreenUpdating = False
Application.Run "sortroutine.archive"
Application.Calculation = xlCalculationManual
Application.Run "cmrstarts1"
Application.Run "cmrterms1"
Application.Run "futurestarts1"
Application.Run "futureterms1"
Application.Run "cmrfutureststarts"
Application.Run "cmrfuturestterms"
Application.Run "price_reviews_started"
Application.Run "price_reviews_due"
Application.Run "nonhits"
Application.Run "extrahits"
Application.Run "cmr.localcallouts"
Sheets("menu").Select
Application.Run ("module1.Cmr_Hide_Please_Wait")
Application.ScreenUpdating = True
Application.Run "module1.protectall"
Sheets("menu").Select
Range("A1").Select
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
Exit Sub
error:
Application.Run ("errorhandler")
End Sub
What I am trying to achieve is to run the errorhandler routine on ANY error within the overall routine. This error handler routine runs an automatuc calculation & protect the worksheets.
I cannot get it to work.
Should I put the
On Error code and error: label in EACH subroutine for it to work. ??
Sub cmrmenu()
On Error GoTo error
Application.ScreenUpdating = False
Dim SH As Worksheet
For Each SH In ThisWorkbook.Sheets
SH.Unprotect "password"
Application.ScreenUpdating = True
Sheets("menu").Select
Application.Run ("Cmr_Show_Please_Wait")
Application.ScreenUpdating = False
Application.Run "sortroutine.archive"
Application.Calculation = xlCalculationManual
Application.Run "cmrstarts1"
Application.Run "cmrterms1"
Application.Run "futurestarts1"
Application.Run "futureterms1"
Application.Run "cmrfutureststarts"
Application.Run "cmrfuturestterms"
Application.Run "price_reviews_started"
Application.Run "price_reviews_due"
Application.Run "nonhits"
Application.Run "extrahits"
Application.Run "cmr.localcallouts"
Sheets("menu").Select
Application.Run ("module1.Cmr_Hide_Please_Wait")
Application.ScreenUpdating = True
Application.Run "module1.protectall"
Sheets("menu").Select
Range("A1").Select
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
Exit Sub
error:
Application.Run ("errorhandler")
End Sub
What I am trying to achieve is to run the errorhandler routine on ANY error within the overall routine. This error handler routine runs an automatuc calculation & protect the worksheets.
I cannot get it to work.
Should I put the
On Error code and error: label in EACH subroutine for it to work. ??