通勤認定エクセルツール対応14

This commit is contained in:
guanxiangwei
2026-05-30 16:47:51 +09:00
parent 29c9200132
commit f84e4b4d3b
23 changed files with 794 additions and 675 deletions

View File

@@ -1,8 +1,23 @@
Attribute VB_Name = "Common_Button"
Option Explicit
' --- Public Variables ---
Public lastErrorMsg As String
' --- Private Variables ---
Private m_LastErrorMsg As String
' ============================================================
' Get/Set last error message
' ============================================================
Public Sub SetLastErrorMsg(msg As String)
m_LastErrorMsg = msg
End Sub
Public Function GetLastErrorMsg() As String
GetLastErrorMsg = m_LastErrorMsg
End Function
Public Sub ClearLastErrorMsg()
m_LastErrorMsg = ""
End Sub
' ============================================================
' Module Name: Common_Button
@@ -67,6 +82,7 @@ Sub RefreshCache_Button()
Exit Sub
ErrorHandler:
Debug.Print "sheetName = " & sheetName
HandleError "RefreshCache_Button"
End Sub
@@ -373,10 +389,10 @@ Public Function RunValidationSilent(ws As Worksheet) As Long
Dim r As Long
Dim hasError As Boolean: hasError = False
For r = startRow To lastDataRow
lastErrorMsg = ""
Application.Run validate, ws, r, lastDataRow
If lastErrorMsg <> "" Then
Err.Raise ERR_VALIDATION_FAILED, "RunValidationSilent", lastErrorMsg
SetLastErrorMsg ""
Application.Run validate, ws, r, lastDataRow
If GetLastErrorMsg() <> "" Then
Err.Raise ERR_VALIDATION_FAILED, "RunValidationSilent", GetLastErrorMsg()
End If
Dim errorMessage As String: errorMessage = Trim(ws.Cells(r, errorCol).Value)
Dim errorCode As String: errorCode = GetCode(errorMessage)