debug: D3セルの状態メッセージをイミディエイトウィンドウにも出力

処理開始/完了/失敗のD3表示内容を[D3]プレフィックス付きでDebug.Printし、フリーズ調査時にログだけで状態を追えるようにした。

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Kenichiro NOGI 2026-09-18 19:01:48 +09:00
parent 49ef4c5358
commit 97f371db3f

View File

@ -37,6 +37,7 @@ Sub run()
defaultSh.Range("D4").Value = Now
defaultSh.Range("D3").Value = "取込処理中..."
Debug.Print "[D3] " & defaultSh.Range("D3").Value
Application.ScreenUpdating = False '画面更新停止
Application.Calculation = xlManual '自動計算停止
'------------------------------------------
@ -58,11 +59,14 @@ Cleanup:
If Err.Number <> 0 Then
defaultSh.Range("D3").Value = "取込処理失敗(エラー): " & Err.Description
Debug.Print "[D3] " & defaultSh.Range("D3").Value
Err.Clear
ElseIf Not (exportSuccess And getSuccess) Then
defaultSh.Range("D3").Value = "取込処理失敗(データ取得エラー)"
Debug.Print "[D3] " & defaultSh.Range("D3").Value
Else
defaultSh.Range("D3").Value = "取込処理完了"
Debug.Print "[D3] " & defaultSh.Range("D3").Value
End If
End Sub