Option Explicit
' Public Bln_Err As Boolean ’A01_Public へ記入
Public IsCall As Boolean
Public ErrProsName As String
Public ErrMsg As String
'====================================================
' Main Sub :メインとなるプロシージャ
'====================================================
Sub ☆☆☆()
Dim nmlTmn As Boolean '正常終了フラグ:normal Termination
Bln_Err = False
nmlTmn = False
ErrProsName = "☆☆☆"
On Error GoTo ☆☆☆_Err
Call showStatus(" 中")
Call StopUpdating
Call SetObject
' If BLN_Err = False Then ’適宜使用
' 処理記入
IsCall = False '初期値
'================================================
' IsCall = True
' Call ★★★
' IsCall = False
'================================================
nmlTmn = True
'End If
☆☆☆_Exit:
' エラーを無視
On Error Resume Next
Call ReSetObject
Call Updating
If nmlTmn Then
MsgBox " 完了♪"
End If
'エラー制御を戻す
On Error GoTo 0
Exit Sub
☆☆☆_Err:
Bln_Err = True
MsgBox "実行時エラー:" & Err.Number & "" & _
Err.Description & vbCr & _
"処理を終了します。", vbExclamation, ErrProsName
Err.Clear
'エラー情報クリア
GoTo ☆☆☆_Exit
End Sub
'====================================================
'-----------------------------------------------------------------------
' Call Sub :Call されるプロシージャ
'-----------------------------------------------------------------------
Sub ★★★()
ErrProsName = "★★★"
On Error GoTo ★★★_Err
Call showStatus(" 中")
If IsCall = False Then
Bln_Err = False
Call StopUpdating
Call SetObject
End If
'If Bln_Err = False Then '適宜使用
'処理記入
'End If
★★★_Exit:
'エラーを無視
On Error Resume Next
If IsCall = False Then
Call ReSetObject
Call Updating
If Bln_Err = False Then
MsgBox " 完了♪"
End If
End If
'エラー制御を戻す
On Error GoTo 0
Exit Sub
★★★_Err:
Bln_Err = True
MsgBox "実行時エラー:" & Err.Number & "" & _
Err.Description & vbCr & _
"処理を終了します。", vbExclamation, ErrProsName
End Sub
'-----------------------------------------------------------------------
' Midi Call Sub:CallされCallするプロシージャ
'-----------------------------------------------------------------------
Sub ●●●()
Dim BlnCall As Boolean 'このプロシージャー内で宣言
ErrProsName = "●●●"
On Error GoTo ●●●_Err
Call showStatus(" 中")
If Bln_Err = False Then
If IsCall = False Then
Call StopUpdating
Call SetObject
Else
BlnCall = True
End If
IsCall = False '初期値
'処理記入
'================================================
'IsCall = True
'Call ●●●2
'IsCall = False
'================================================
'処理記入
End If
●●●_Exit:
'エラーを無視
On Error Resume Next
If BlnCall = False Then
Call ReSetObject
Call Updating
If Bln_Err = False Then
MsgBox " 完了♪"
End If
End If
'エラー制御を戻す
On Error GoTo 0
Exit Sub
●●●_Err:
Bln_Err = True
MsgBox "実行時エラー:" & Err.Nuer & "" & _
Err.Description & vbCr & _
"処理を終了します。", vbExclamation, ErrProsName
GoTo ●●●_Exit
End Sub
コメント