Share via

VBA solution

Lakshmi Polisetti 20 Reputation points
2025-09-14T22:41:11.78+00:00
Option Explicit
Public Sub UpdateGenerateAndCumulativeFromECT()
    Dim startTime As Double
    Dim genMsg As String, cumMsg As String
    Dim summary As String
    
    startTime = Timer
    
    ' --- Run Generate update ---
    On Error Resume Next
    Call UpdateGenerateFromECTExtract
    genMsg = "Generate update completed successfully."
    If Err.Number <> 0 Then
        genMsg = "Generate update failed: " & Err.Description
        Err.Clear
    End If
    On Error GoTo 0
    
    ' --- Run Cumulative update ---
    On Error Resume Next
    Call UpdateCumulativeFromECTExtract
    cumMsg = "Cumulative update completed successfully."
    If Err.Number <> 0 Then
        cumMsg = "Cumulative update failed: " & Err.Description
        Err.Clear
    End If
    On Error GoTo 0
    
    ' --- Build summary ---
    summary = "ECT Updates Finished!" & vbCrLf & vbCrLf & _
              genMsg & vbCrLf & _
              cumMsg & vbCrLf & vbCrLf & _
              "Total time: " & Format(Timer - startTime, "0.0") & " seconds"
    
    MsgBox summary, vbInformation, "ECT Update Summary"
End Sub
Microsoft 365 and Office | Excel | For home | Android

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.