<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: DocxForgePro</title>
    <description>The latest articles on DEV Community by DocxForgePro (@docxforgepro).</description>
    <link>https://dev.to/docxforgepro</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4285649%2Fe1e67ab1-1363-4592-af43-8b84f3958a70.jpg</url>
      <title>DEV Community: DocxForgePro</title>
      <link>https://dev.to/docxforgepro</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/docxforgepro"/>
    <language>en</language>
    <item>
      <title>Excel Macros vs Purpose-Built Document Automation Tools</title>
      <dc:creator>DocxForgePro</dc:creator>
      <pubDate>Sun, 06 Dec 2026 02:27:38 +0000</pubDate>
      <link>https://dev.to/docxforgepro/excel-macros-vs-purpose-built-document-automation-tools-22bp</link>
      <guid>https://dev.to/docxforgepro/excel-macros-vs-purpose-built-document-automation-tools-22bp</guid>
      <description>&lt;p&gt;Originally published on &lt;a href="https://docxforgepro.com/blog/excel-macros-vs-purpose-built-document-automation-tools" rel="noopener noreferrer"&gt;DocxForge Pro&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Tool Selection&lt;/p&gt;

&lt;p&gt;VBA can be the right answer for a narrow workflow. A purpose-built tool becomes attractive when batch volume, images, PDF output, handoff, recovery, and ongoing changes cost more than the flexibility of custom code.&lt;/p&gt;

&lt;p&gt;Workflow fit&lt;/p&gt;

&lt;p&gt;Critical gaps&lt;/p&gt;

&lt;p&gt;Ownership cost&lt;/p&gt;

&lt;p&gt;Measured pilot&lt;/p&gt;

&lt;p&gt;Do not replace working VBA because it is VBA. Replace or redesign it when measured operating requirements, maintenance, risk, or ownership no longer fit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick answer: choose the smallest maintainable solution
&lt;/h2&gt;

&lt;p&gt;Keep VBA when the workflow is stable, understandable, owned, tested, and inexpensive to support. Evaluate a purpose-built tool when the team repeatedly rebuilds validation, image insertion, naming, DOCX/PDF output, status handling, error recovery, and user instructions across several macros.&lt;/p&gt;

&lt;h3&gt;
  
  
  VBA advantage
&lt;/h3&gt;

&lt;p&gt;Direct access to Excel and Office, custom logic, rapid prototypes, and no separate interface for a capable owner.&lt;/p&gt;

&lt;h3&gt;
  
  
  VBA cost
&lt;/h3&gt;

&lt;p&gt;Code review, macro policy, testing, documentation, deployment, template coupling, recovery, and key-person dependency.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tool advantage
&lt;/h3&gt;

&lt;p&gt;A repeatable interface can move common generation tasks from custom code into a supported operating workflow.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tool cost
&lt;/h3&gt;

&lt;p&gt;License, adoption, configuration, product limits, training, vendor dependence, and fit testing still matter.&lt;/p&gt;

&lt;h2&gt;
  
  
  Compare requirements before comparing products
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Scope
&lt;/h3&gt;

&lt;p&gt;Define document types, templates, fields, images, outputs, naming, volume, users, and exception paths.&lt;/p&gt;

&lt;h3&gt;
  
  
  Change rate
&lt;/h3&gt;

&lt;p&gt;Measure how often columns, bookmarks, tags, templates, output rules, or operating policies change.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ownership
&lt;/h3&gt;

&lt;p&gt;Name who can read, review, test, deploy, support, and recover the VBA or configured tool workflow.&lt;/p&gt;

&lt;h3&gt;
  
  
  Control level
&lt;/h3&gt;

&lt;p&gt;Define validation, permissions, logging, output review, recovery, retention, and approval requirements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Compare the complete lifecycle&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A 30-line prototype is not comparable to a production tool, and a configured tool is not comparable to an unlimited custom development platform. Include preparation, testing, daily operation, exceptions, changes, support, and retirement.&lt;/p&gt;

&lt;h2&gt;
  
  
  When Excel VBA remains a sensible choice
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Narrow stable workflow
&lt;/h3&gt;

&lt;p&gt;One team, a small template set, predictable inputs, modest volume, and few exception paths.&lt;/p&gt;

&lt;h3&gt;
  
  
  Real technical owner
&lt;/h3&gt;

&lt;p&gt;A named person can review the code, maintain documentation, test changes, and support recovery.&lt;/p&gt;

&lt;h3&gt;
  
  
  Custom Office logic
&lt;/h3&gt;

&lt;p&gt;The workflow needs specialized Excel or Word behavior that would be awkward or impossible to configure elsewhere.&lt;/p&gt;

&lt;h3&gt;
  
  
  Controlled deployment
&lt;/h3&gt;

&lt;p&gt;Macro policies, trusted publishers or approved locations, versions, backups, and user instructions are managed.&lt;/p&gt;

&lt;p&gt;VBA is not merely a temporary workaround. A well-engineered macro with strict inputs, preflight checks, safe file handling, tests, and ownership can remain appropriate for years.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where a macro portfolio starts to strain
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Repeated infrastructure code
&lt;/h3&gt;

&lt;p&gt;Every macro rebuilds file validation, Word startup, tags or bookmarks, images, PDF export, naming, logs, and cleanup.&lt;/p&gt;

&lt;h3&gt;
  
  
  Template coupling
&lt;/h3&gt;

&lt;p&gt;A renamed column, bookmark, tag, folder, or output rule requires code changes and regression testing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key-person dependency
&lt;/h3&gt;

&lt;p&gt;Only one person understands deployment, error messages, recovery, and why a special case exists.&lt;/p&gt;

&lt;h3&gt;
  
  
  Operational fragmentation
&lt;/h3&gt;

&lt;p&gt;Different teams run different copies with inconsistent rules, fixes, permissions, and documentation.&lt;/p&gt;

&lt;p&gt;The issue is not the number of VBA lines by itself. A long, controlled macro can be safer than a short undocumented one. The relevant question is whether the organization can sustain its behavior and ownership.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where a purpose-built tool can reduce custom maintenance
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Repeatable generation patterns
&lt;/h3&gt;

&lt;p&gt;The same Excel-to-Word, image, naming, DOCX/PDF, and batch requirements recur across workflows.&lt;/p&gt;

&lt;h3&gt;
  
  
  Operator handoff
&lt;/h3&gt;

&lt;p&gt;Business users need a defined interface and operating procedure instead of editing or debugging code.&lt;/p&gt;

&lt;h3&gt;
  
  
  Standardized support
&lt;/h3&gt;

&lt;p&gt;The team wants one supported generation layer rather than several independently maintained macros.&lt;/p&gt;

&lt;h3&gt;
  
  
  Known product boundaries
&lt;/h3&gt;

&lt;p&gt;The required templates, data model, images, outputs, and scale fit the tested product capabilities.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A tool is not automatically lower risk&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Confirm product limits, installation, Office dependencies, licensing, update behavior, data handling, permissions, recovery, support, export quality, and what remains manual. A poor fit merely moves technical debt into configuration and workarounds.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create ToolDecision in one exact A–E contract
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Use the exact worksheet name&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ToolDecision&lt;/code&gt; is the required Excel tab name and intentionally has no space.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Required headers in A1:E1&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Criterion; Weight; MacroScore; ToolScore; Evidence&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Required criteria in A2:A11&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Setup speed; Custom logic flexibility; Batch volume; Image handling; DOCX and PDF output; Error isolation; Template change effort; Multi-user handoff; Support ownership; Recovery and audit&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Enter whole-number weights and scores from 1 to 5. A higher score means better fit. Weight 4–5 plus score 1–2 creates a critical gap. Every row needs a literal evidence reference of 1–500 characters. Reserve A14:B19 for results.&lt;/p&gt;

&lt;h3&gt;
  
  
  Weight
&lt;/h3&gt;

&lt;p&gt;Business importance of the criterion: 1 is low, 5 is critical.&lt;/p&gt;

&lt;h3&gt;
  
  
  MacroScore
&lt;/h3&gt;

&lt;p&gt;How well the current or proposed VBA solution meets the criterion with evidence.&lt;/p&gt;

&lt;h3&gt;
  
  
  ToolScore
&lt;/h3&gt;

&lt;p&gt;How well the tested purpose-built tool meets the same criterion with evidence.&lt;/p&gt;

&lt;h3&gt;
  
  
  Evidence
&lt;/h3&gt;

&lt;p&gt;Pilot result, code review, support record, quote, output test, recovery test, or named owner—not an unsupported opinion.&lt;/p&gt;

&lt;h2&gt;
  
  
  Free VBA helper: summarize the tool-fit matrix
&lt;/h2&gt;

&lt;p&gt;Save the workbook as &lt;code&gt;.xlsm&lt;/code&gt;, create &lt;code&gt;ToolDecision&lt;/code&gt;, and enter the exact contract. Press &lt;code&gt;Alt+F11&lt;/code&gt;, choose &lt;code&gt;Insert → Module&lt;/code&gt;, paste the reviewed code, then use &lt;code&gt;Alt+F8&lt;/code&gt; to run &lt;code&gt;CompareMacroAndAutomationToolFit&lt;/code&gt; only when macros are allowed by organizational policy.&lt;/p&gt;

&lt;p&gt;The macro validates literal weights, scores, and evidence, calculates weighted fit, counts critical gaps, and produces a review prompt. It does not benchmark either option, validate DocxForge Pro, estimate cost, or authorize a purchase.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Excel VBA — macro versus tool decision matrix&lt;/strong&gt;&lt;strong&gt;Reviewed inputs, not an automatic purchase decision&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Option Explicit

Private Const FIRST_CRITERION_ROW As Long = 2
Private Const LAST_CRITERION_ROW As Long = 11

Public Sub CompareMacroAndAutomationToolFit()
    Dim ws As Worksheet
    Dim rowNumber As Long
    Dim weightValue As Long
    Dim macroScore As Long, toolScore As Long
    Dim evidenceText As String
    Dim maximumWeightedScore As Long
    Dim macroWeightedScore As Long, toolWeightedScore As Long
    Dim macroCriticalGaps As Long, toolCriticalGaps As Long
    Dim macroFit As Double, toolFit As Double
    Dim comparisonText As String
    Dim previousScreenUpdating As Boolean

    On Error GoTo CleanFail
    previousScreenUpdating = Application.ScreenUpdating
    Application.ScreenUpdating = False

    Set ws = ThisWorkbook.Worksheets("ToolDecision")
    ValidateDecisionContract ws

    For rowNumber = FIRST_CRITERION_ROW To LAST_CRITERION_ROW
        weightValue = ReadWholeNumber(ws.Cells(rowNumber, 2), _
            "Weight", rowNumber, 1, 5)
        macroScore = ReadWholeNumber(ws.Cells(rowNumber, 3), _
            "MacroScore", rowNumber, 1, 5)
        toolScore = ReadWholeNumber(ws.Cells(rowNumber, 4), _
            "ToolScore", rowNumber, 1, 5)
        evidenceText = ReadEvidence(ws.Cells(rowNumber, 5), _
            rowNumber)

        maximumWeightedScore = maximumWeightedScore + _
            weightValue * 5
        macroWeightedScore = macroWeightedScore + _
            weightValue * macroScore
        toolWeightedScore = toolWeightedScore + _
            weightValue * toolScore

        If weightValue &amp;gt;= 4 And macroScore &amp;lt;= 2 Then
            macroCriticalGaps = macroCriticalGaps + 1
        End If
        If weightValue &amp;gt;= 4 And toolScore &amp;lt;= 2 Then
            toolCriticalGaps = toolCriticalGaps + 1
        End If
    Next rowNumber

    macroFit = macroWeightedScore / maximumWeightedScore
    toolFit = toolWeightedScore / maximumWeightedScore
    comparisonText = BuildComparison(macroFit, toolFit, _
        macroCriticalGaps, toolCriticalGaps)

    ws.Range("A14:A19").Value = Application.Transpose(Array( _
        "Macro weighted fit", "Tool weighted fit", _
        "Macro critical gaps", "Tool critical gaps", _
        "Comparison", "Review note"))
    ws.Range("B14").Value2 = macroFit
    ws.Range("B15").Value2 = toolFit
    ws.Range("B16").Value2 = macroCriticalGaps
    ws.Range("B17").Value2 = toolCriticalGaps
    ws.Range("B18").Value2 = comparisonText
    ws.Range("B19").Value2 = _
        "Validate scores, costs, controls, and real outputs in a pilot."
    ws.Range("B14:B15").NumberFormat = "0.0%"
    ws.Range("B16:B17").NumberFormat = "0"
    ws.Range("A18:B19").NumberFormat = "@"

    Application.ScreenUpdating = previousScreenUpdating
    MsgBox "Tool-fit comparison created in A14:B19.", vbInformation
    Exit Sub

CleanFail:
    Application.ScreenUpdating = previousScreenUpdating
    MsgBox "Tool-fit comparison stopped. Error " &amp;amp; Err.Number &amp;amp; _
        ": " &amp;amp; Err.Description, vbExclamation
End Sub

Private Sub ValidateDecisionContract(ByVal ws As Worksheet)
    Dim headers As Variant
    Dim criteria As Variant
    Dim columnNumber As Long
    Dim rowNumber As Long

    headers = Array("Criterion", "Weight", "MacroScore", _
        "ToolScore", "Evidence")
    criteria = Array( _
        "Setup speed", _
        "Custom logic flexibility", _
        "Batch volume", _
        "Image handling", _
        "DOCX and PDF output", _
        "Error isolation", _
        "Template change effort", _
        "Multi-user handoff", _
        "Support ownership", _
        "Recovery and audit")

    For columnNumber = 1 To 5
        RequireExactText ws.Cells(1, columnNumber), _
            CStr(headers(columnNumber - 1)), _
            "header " &amp;amp; ws.Cells(1, columnNumber).Address(False, False)
    Next columnNumber

    For rowNumber = FIRST_CRITERION_ROW To LAST_CRITERION_ROW
        RequireExactText ws.Cells(rowNumber, 1), _
            CStr(criteria(rowNumber - FIRST_CRITERION_ROW)), _
            "criterion in row " &amp;amp; rowNumber
    Next rowNumber
End Sub

Private Sub RequireExactText(ByVal sourceCell As Range, _
                             ByVal expectedText As String, _
                             ByVal fieldLabel As String)
    If sourceCell.HasFormula Then
        RaiseCellError sourceCell, fieldLabel &amp;amp; _
            " must be literal text, not a formula."
    End If
    If IsError(sourceCell.Value2) Then
        RaiseCellError sourceCell, fieldLabel &amp;amp; _
            " contains an Excel error."
    End If
    If VarType(sourceCell.Value2) &amp;lt;&amp;gt; vbString Then
        RaiseCellError sourceCell, fieldLabel &amp;amp; _
            " must be stored as text."
    End If
    If StrComp(CStr(sourceCell.Value2), expectedText, _
               vbBinaryCompare) &amp;lt;&amp;gt; 0 Then
        RaiseCellError sourceCell, "Expected '" &amp;amp; expectedText &amp;amp; "'."
    End If
End Sub

Private Function ReadWholeNumber(ByVal sourceCell As Range, _
                                 ByVal fieldName As String, _
                                 ByVal rowNumber As Long, _
                                 ByVal minimumValue As Long, _
                                 ByVal maximumValue As Long) As Long
    Dim numericValue As Double

    If sourceCell.HasFormula Then
        RaiseCellError sourceCell, fieldName &amp;amp; _
            " must be a reviewed literal number in row " &amp;amp; _
            rowNumber &amp;amp; "."
    End If
    If IsError(sourceCell.Value2) Then
        RaiseCellError sourceCell, fieldName &amp;amp; _
            " contains an Excel error in row " &amp;amp; rowNumber &amp;amp; "."
    End If

    Select Case VarType(sourceCell.Value2)
        Case vbByte, vbInteger, vbLong, vbSingle, _
             vbDouble, vbCurrency, vbDecimal
        Case Else
            RaiseCellError sourceCell, fieldName &amp;amp; _
                " must be numeric, not text, in row " &amp;amp; rowNumber &amp;amp; "."
    End Select

    numericValue = CDbl(sourceCell.Value2)
    If numericValue &amp;lt;&amp;gt; Fix(numericValue) Or _
       numericValue &amp;lt; minimumValue Or _
       numericValue &amp;gt; maximumValue Then
        RaiseCellError sourceCell, fieldName &amp;amp; _
            " must be a whole number from " &amp;amp; minimumValue &amp;amp; _
            " to " &amp;amp; maximumValue &amp;amp; " in row " &amp;amp; rowNumber &amp;amp; "."
    End If

    ReadWholeNumber = CLng(numericValue)
End Function

Private Function ReadEvidence(ByVal sourceCell As Range, _
                              ByVal rowNumber As Long) As String
    Dim evidenceText As String

    If sourceCell.HasFormula Then
        RaiseCellError sourceCell, _
            "Evidence must be literal text in row " &amp;amp; rowNumber &amp;amp; "."
    End If
    If IsError(sourceCell.Value2) Then
        RaiseCellError sourceCell, _
            "Evidence contains an Excel error in row " &amp;amp; rowNumber &amp;amp; "."
    End If
    If VarType(sourceCell.Value2) &amp;lt;&amp;gt; vbString Then
        RaiseCellError sourceCell, _
            "Evidence must be text in row " &amp;amp; rowNumber &amp;amp; "."
    End If

    evidenceText = CStr(sourceCell.Value2)
    If Len(evidenceText) = 0 Or Len(evidenceText) &amp;gt; 500 Then
        RaiseCellError sourceCell, _
            "Evidence must contain 1 to 500 characters in row " &amp;amp; _
            rowNumber &amp;amp; "."
    End If
    If StrComp(evidenceText, Trim$(evidenceText), _
               vbBinaryCompare) &amp;lt;&amp;gt; 0 Then
        RaiseCellError sourceCell, _
            "Evidence cannot start or end with spaces in row " &amp;amp; _
            rowNumber &amp;amp; "."
    End If
    If ContainsControlCharacter(evidenceText) Then
        RaiseCellError sourceCell, _
            "Evidence contains a control character in row " &amp;amp; _
            rowNumber &amp;amp; "."
    End If

    ReadEvidence = evidenceText
End Function

Private Function ContainsControlCharacter(ByVal textValue As String) _
    As Boolean
    Dim characterIndex As Long
    Dim characterCode As Long

    For characterIndex = 1 To Len(textValue)
        characterCode = AscW(Mid$(textValue, characterIndex, 1))
        If characterCode &amp;gt;= 0 And characterCode &amp;lt; 32 Then
            ContainsControlCharacter = True
            Exit Function
        End If
    Next characterIndex
End Function

Private Function BuildComparison(ByVal macroFit As Double, _
                                 ByVal toolFit As Double, _
                                 ByVal macroGaps As Long, _
                                 ByVal toolGaps As Long) As String
    If macroGaps &amp;gt; 0 And toolGaps &amp;gt; 0 Then
        BuildComparison = _
            "BOTH OPTIONS HAVE CRITICAL GAPS—REMEDIATE BEFORE PILOT"
    ElseIf macroGaps &amp;gt; 0 Then
        BuildComparison = _
            "MACRO HAS CRITICAL GAPS—VALIDATE THE TOOL IN A PILOT"
    ElseIf toolGaps &amp;gt; 0 Then
        BuildComparison = _
            "TOOL HAS CRITICAL GAPS—KEEP VBA UNDER REVIEW"
    ElseIf macroFit &amp;gt; toolFit Then
        BuildComparison = _
            "VBA SCORES HIGHER—CONFIRM OWNERSHIP AND MAINTENANCE"
    ElseIf toolFit &amp;gt; macroFit Then
        BuildComparison = _
            "TOOL SCORES HIGHER—VALIDATE COST AND OUTPUTS IN A PILOT"
    Else
        BuildComparison = _
            "FIT SCORES ARE EQUAL—COMPARE COST, RISK, AND OWNERSHIP"
    End If
End Function

Private Sub RaiseCellError(ByVal sourceCell As Range, _
                           ByVal messageText As String)
    Err.Raise vbObjectError + 6601, , _
        sourceCell.Address(False, False) &amp;amp; ": " &amp;amp; messageText
End Sub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Test both options against the same pilot
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Same inputs
&lt;/h3&gt;

&lt;p&gt;Use the same representative spreadsheet rows or case, templates, images, naming, and output formats.&lt;/p&gt;

&lt;h3&gt;
  
  
  Same success rules
&lt;/h3&gt;

&lt;p&gt;Measure elapsed and active time, defects, review effort, exceptions, recovery, and support work.&lt;/p&gt;

&lt;h3&gt;
  
  
  Change test
&lt;/h3&gt;

&lt;p&gt;Rename or add one approved field, update a template, and measure the controlled effort required in each option.&lt;/p&gt;

&lt;h3&gt;
  
  
  Failure test
&lt;/h3&gt;

&lt;p&gt;Use a missing image, occupied output name, invalid value, interrupted run, and recovery scenario without risking production files.&lt;/p&gt;

&lt;p&gt;Update the matrix with the pilot evidence. If the result depends on optimistic guesses, the decision is not ready.&lt;/p&gt;

&lt;h2&gt;
  
  
  Compare VBA with the relevant DocxForge Pro module
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Contractor
&lt;/h3&gt;

&lt;p&gt;One case populates several different Word templates. Compare the complete case pack with the macros and manual steps it would replace.&lt;/p&gt;

&lt;h3&gt;
  
  
  Factory
&lt;/h3&gt;

&lt;p&gt;Many independent Excel rows use one standard Word template. Compare the entire batch workflow, not only one successful row.&lt;/p&gt;

&lt;h3&gt;
  
  
  Do not combine unlike benefits
&lt;/h3&gt;

&lt;p&gt;Contractor and Factory solve different document structures. Count savings only for the module and process actually tested.&lt;/p&gt;

&lt;h3&gt;
  
  
  Keep Excel in scope
&lt;/h3&gt;

&lt;p&gt;Purpose-built generation does not remove the need for governed data, display-ready values, approved templates, review, or recovery.&lt;/p&gt;

&lt;h3&gt;
  
  
  Contractor: one case and several different templates
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvzk8d0j0u8gia8g3ux45.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvzk8d0j0u8gia8g3ux45.png" alt="DocxForge Pro Contractor case data used in a VBA versus tool pilot" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Use one controlled case dataset.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Feb2f6li52wa664alw59l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Feb2f6li52wa664alw59l.png" alt="DocxForge Pro Contractor document selection compared with a macro-built pack" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Compare the complete multi-template pack.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Factory: many rows and one standard template
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgumwo4k4k51fnjggobna.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgumwo4k4k51fnjggobna.png" alt="DocxForge Pro Factory Excel rows used in a batch comparison" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Use representative rows and exceptions.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7y2h2aor2sadpxsktj5d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7y2h2aor2sadpxsktj5d.png" alt="DocxForge Pro Factory template and output settings compared with VBA" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Compare one-template generation and outputs.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Test the purpose-built workflow against your current VBA&lt;/strong&gt;7 days free, then $38 every 3 months • 14-day refund.&lt;/p&gt;

&lt;p&gt;Same inputsSame outputsFailure testMeasured support&lt;/p&gt;

&lt;p&gt;Start Free 7-Day Trial&lt;/p&gt;

&lt;h2&gt;
  
  
  Interpret the matrix carefully
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Weights are subjective
&lt;/h3&gt;

&lt;p&gt;Agree them before scoring and record who approved them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Scores need evidence
&lt;/h3&gt;

&lt;p&gt;A marketing claim, demo, or successful happy-path run is not enough for a high production score.&lt;/p&gt;

&lt;h3&gt;
  
  
  Fit is not ROI
&lt;/h3&gt;

&lt;p&gt;Add setup, licensing, maintenance, support, migration, training, and opportunity cost separately.&lt;/p&gt;

&lt;h3&gt;
  
  
  Today is not the lifecycle
&lt;/h3&gt;

&lt;p&gt;Reassess after template, volume, staffing, security, Office, product, or operating changes.&lt;/p&gt;

&lt;p&gt;A higher weighted score does not prove lower risk or cost. Use it to expose assumptions and critical gaps, then combine the result with a financial model and responsible approval.&lt;/p&gt;

&lt;h2&gt;
  
  
  Continue from tool fit to an operating decision
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://docxforgepro.com/blog/when-does-it-make-sense-to-replace-manual-document-assembly" rel="noopener noreferrer"&gt;Check automation readiness&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Confirm the process is stable enough to automate before selecting a tool.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://docxforgepro.com/blog/how-to-justify-an-excel-to-word-automation-tool-to-management" rel="noopener noreferrer"&gt;Build the management case&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Combine pilot evidence, payback, ownership, recovery, and approval gates.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://docxforgepro.com/blog/how-to-migrate-from-manual-copy-paste-to-structured-document-generation" rel="noopener noreferrer"&gt;Plan a controlled migration&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Define data, template, generation, review, operating, and rollback contracts.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://docxforgepro.com/blog/how-to-fill-word-templates-from-excel-automatically" rel="noopener noreferrer"&gt;Review the core Excel-to-Word workflow&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Compare a guarded VBA implementation with a structured product workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently asked questions
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Are Excel macros a bad choice for document automation?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No. VBA can be an efficient choice for a narrow, stable workflow with a capable owner, modest volume, controlled templates, limited users, and acceptable maintenance and recovery effort.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When does VBA usually become expensive to maintain?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Maintenance grows when templates, fields, images, output rules, users, exception paths, security requirements, or document types change frequently and the knowledge remains concentrated in one person.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does a purpose-built tool remove the need for process design?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No. Source data, templates, naming, images, permissions, review, recovery, retention, and release ownership still need explicit contracts and testing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What does the VBA decision helper prove?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It proves only that the entered weights, scores, and evidence references are structurally valid and summarizes them. It does not benchmark either option or make an approved purchasing decision.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How does Factory differ from a custom batch macro?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Factory is designed around many independent Excel rows, one standard Word template, and a separate output for each row. Compare it with the complete macro lifecycle, including validation, naming, images, PDF, errors, support, and recovery.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When is Contractor the relevant comparison?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Use Contractor when one case must populate several different Word templates. Compare it with the macros or manual steps required to keep data consistent across the complete document pack.&lt;/p&gt;




&lt;p&gt;This article was prepared with AI assistance.&lt;/p&gt;

</description>
      <category>automation</category>
      <category>vba</category>
      <category>excel</category>
      <category>pdf</category>
    </item>
    <item>
      <title>Desktop vs Cloud Document Automation: Security Tradeoffs</title>
      <dc:creator>DocxForgePro</dc:creator>
      <pubDate>Sun, 06 Dec 2026 02:27:25 +0000</pubDate>
      <link>https://dev.to/docxforgepro/desktop-vs-cloud-document-automation-security-tradeoffs-1387</link>
      <guid>https://dev.to/docxforgepro/desktop-vs-cloud-document-automation-security-tradeoffs-1387</guid>
      <description>&lt;p&gt;Originally published on &lt;a href="https://docxforgepro.com/blog/desktop-vs-cloud-why-local-software-is-more-secure" rel="noopener noreferrer"&gt;DocxForge Pro&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Security Architecture&lt;/p&gt;

&lt;p&gt;Local processing can reduce uploads and third-party handling, while cloud platforms can provide centralized identity, logging, patching, and resilience. Compare the controls—not the labels.&lt;/p&gt;

&lt;p&gt;Threat model first&lt;/p&gt;

&lt;p&gt;Local controls&lt;/p&gt;

&lt;p&gt;Cloud controls&lt;/p&gt;

&lt;p&gt;Evidence required&lt;/p&gt;

&lt;p&gt;Neither “desktop” nor “cloud” is a security verdict. The safer architecture is the one that meets the workflow’s approved controls and operating requirements.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick answer: local changes the threat model—it does not eliminate risk
&lt;/h2&gt;

&lt;p&gt;A local workflow can be the stronger choice when sensitive Excel, Word, image, and PDF files must remain inside an approved environment and the organization can secure its endpoints and storage. Cloud can be stronger when centralized access, logging, managed infrastructure, collaboration, and recovery are required and the provider and tenant are correctly governed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Local advantage
&lt;/h3&gt;

&lt;p&gt;Generation can run without sending document contents to a remote processing service.&lt;/p&gt;

&lt;h3&gt;
  
  
  Local responsibility
&lt;/h3&gt;

&lt;p&gt;The organization owns endpoint hardening, permissions, backups, patches, logs, and recovery.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cloud advantage
&lt;/h3&gt;

&lt;p&gt;A managed platform can centralize identity, monitoring, updates, resilience, and collaboration.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cloud responsibility
&lt;/h3&gt;

&lt;p&gt;The organization must assess providers, processors, configuration, data location, retention, and exit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with the data flow and threat model
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Assets
&lt;/h3&gt;

&lt;p&gt;List spreadsheets, case data, Word templates, photos, signatures, stamps, generated DOCX/PDF files, logs, and backups.&lt;/p&gt;

&lt;h3&gt;
  
  
  Actors
&lt;/h3&gt;

&lt;p&gt;Identify operators, reviewers, administrators, support staff, remote users, service providers, and anyone who can access storage.&lt;/p&gt;

&lt;h3&gt;
  
  
  Trust boundaries
&lt;/h3&gt;

&lt;p&gt;Mark every device, share, sync client, email transfer, API, cloud tenant, processor, backup, and removable medium crossed by the data.&lt;/p&gt;

&lt;h3&gt;
  
  
  Failure scenarios
&lt;/h3&gt;

&lt;p&gt;Consider stolen credentials, malware, incorrect permissions, accidental sharing, provider compromise, outages, deleted files, and incomplete runs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Compare the same workflow&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Do not compare a hardened local endpoint with an unmanaged cloud tenant—or a managed cloud platform with an unpatched personal PC. Use the same data classification, users, outputs, retention period, recovery objective, and approval rules.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where local document generation can reduce exposure
&lt;/h2&gt;

&lt;h3&gt;
  
  
  No required content upload
&lt;/h3&gt;

&lt;p&gt;Source data, templates, images, and outputs can stay inside the organization’s approved storage during generation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Smaller processor chain
&lt;/h3&gt;

&lt;p&gt;The generation step may avoid adding a document-processing vendor or additional data sub-processors.&lt;/p&gt;

&lt;h3&gt;
  
  
  Offline operation
&lt;/h3&gt;

&lt;p&gt;A controlled machine can continue generating documents without an active internet connection or cloud account session.&lt;/p&gt;

&lt;h3&gt;
  
  
  Direct storage control
&lt;/h3&gt;

&lt;p&gt;The organization selects the workstation, folders, permissions, backup location, and deletion process.&lt;/p&gt;

&lt;p&gt;These are architectural advantages only when the local environment is actually controlled. Copying outputs to personal email, broadly accessible network shares, unmanaged USB drives, or consumer sync folders can erase the expected benefit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Local risks that must not be hidden
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Compromised endpoint
&lt;/h3&gt;

&lt;p&gt;Malware or a stolen Windows account can expose every accessible source and output file.&lt;/p&gt;

&lt;h3&gt;
  
  
  Broad folder permissions
&lt;/h3&gt;

&lt;p&gt;Local and shared folders often accumulate access that is wider than the business process requires.&lt;/p&gt;

&lt;h3&gt;
  
  
  Patch and macro risk
&lt;/h3&gt;

&lt;p&gt;Unpatched Office, unsigned or unreviewed macros, unsafe templates, and downloaded files create execution risk.&lt;/p&gt;

&lt;h3&gt;
  
  
  Weak recovery and audit
&lt;/h3&gt;

&lt;p&gt;A desktop process may lack tested backups, centralized logs, version history, alerting, or independent recovery.&lt;/p&gt;

&lt;p&gt;“The files never left the PC” is not proof of confidentiality, integrity, availability, authorization, or compliance. Endpoint and storage controls still require owners, evidence, testing, and review.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cloud controls can be stronger—and cloud boundaries can be broader
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Central identity and logging
&lt;/h3&gt;

&lt;p&gt;A mature platform can enforce MFA, conditional access, role-based permissions, audit events, and centralized monitoring.&lt;/p&gt;

&lt;h3&gt;
  
  
  Managed resilience
&lt;/h3&gt;

&lt;p&gt;Providers may offer replicated storage, managed updates, service monitoring, recovery options, and scalable processing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Additional trust relationships
&lt;/h3&gt;

&lt;p&gt;The workflow can involve a vendor, sub-processors, APIs, credentials, regions, integrations, and contractual dependencies.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configuration and availability
&lt;/h3&gt;

&lt;p&gt;Tenant mistakes, excessive sharing, exposed tokens, account lockout, internet failure, rate limits, or service changes can interrupt or expose work.&lt;/p&gt;

&lt;p&gt;Cloud security depends on the selected service, contract, configuration, identity controls, data residency, retention, incident process, and shared-responsibility model. “Cloud” is not one security profile.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create SecurityReview in one exact A–E contract
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Use the exact worksheet name&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;SecurityReview&lt;/code&gt; is the required Excel tab name and intentionally has no space because the VBA opens &lt;code&gt;Worksheets("SecurityReview")&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Required headers in A1:E1&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Control; LocalStatus; LocalEvidence; CloudStatus; CloudEvidence&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Required controls in A2:A11&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Data classification complete; Data location and processors approved; Least-privilege access approved; Encryption requirements approved; Backup and recovery tested; Retention and deletion approved; Logging and audit approved; Patch and vulnerability process approved; Incident response owner assigned; Template and output review approved&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Use exact PASS, PENDING, or FAIL. Every status needs a concise literal evidence reference of 1–500 characters, such as a policy ID, test record, approved configuration, ticket, owner, or review date. Reserve A14:B17 for the summary.&lt;/p&gt;

&lt;h3&gt;
  
  
  PASS
&lt;/h3&gt;

&lt;p&gt;The control has been reviewed and supported by current evidence for that architecture.&lt;/p&gt;

&lt;h3&gt;
  
  
  PENDING
&lt;/h3&gt;

&lt;p&gt;Evidence, approval, testing, or ownership remains incomplete.&lt;/p&gt;

&lt;h3&gt;
  
  
  FAIL
&lt;/h3&gt;

&lt;p&gt;The architecture does not meet the required control and needs remediation or rejection.&lt;/p&gt;

&lt;h3&gt;
  
  
  Evidence reference
&lt;/h3&gt;

&lt;p&gt;A worksheet statement points to evidence; it is not the evidence itself and does not certify the control.&lt;/p&gt;

&lt;h2&gt;
  
  
  Free VBA helper: summarize reviewed security controls
&lt;/h2&gt;

&lt;p&gt;Create &lt;code&gt;SecurityReview&lt;/code&gt;, enter the exact headers, controls, statuses, and evidence references, then run &lt;code&gt;SummarizeDesktopAndCloudSecurityReview&lt;/code&gt;. The macro validates the contract and reports PASS/PENDING/FAIL counts separately. It does not scan the PC, audit a provider, or declare either architecture secure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Run the reviewed VBA example&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Save the workbook as &lt;code&gt;.xlsm&lt;/code&gt;. Press &lt;code&gt;Alt+F11&lt;/code&gt;, choose &lt;code&gt;Insert → Module&lt;/code&gt;, paste the reviewed code, and close the editor. Press &lt;code&gt;Alt+F8&lt;/code&gt;, select &lt;code&gt;SummarizeDesktopAndCloudSecurityReview&lt;/code&gt;, and run it only when macros are permitted by your organization. Do not add a file to a trusted location merely to bypass a warning; use an approved location and reviewed code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Excel VBA — desktop and cloud control summary&lt;/strong&gt;&lt;strong&gt;Evidence register, not security certification&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Option Explicit

Private Const FIRST_CONTROL_ROW As Long = 2
Private Const LAST_CONTROL_ROW As Long = 11

Public Sub SummarizeDesktopAndCloudSecurityReview()
    Dim ws As Worksheet
    Dim rowNumber As Long
    Dim localStatus As String, cloudStatus As String
    Dim localEvidence As String, cloudEvidence As String
    Dim localPass As Long, localPending As Long, localFail As Long
    Dim cloudPass As Long, cloudPending As Long, cloudFail As Long
    Dim previousScreenUpdating As Boolean

    On Error GoTo CleanFail
    previousScreenUpdating = Application.ScreenUpdating
    Application.ScreenUpdating = False

    Set ws = ThisWorkbook.Worksheets("SecurityReview")
    ValidateSecurityReviewContract ws

    For rowNumber = FIRST_CONTROL_ROW To LAST_CONTROL_ROW
        localStatus = ReadExactStatus(ws.Cells(rowNumber, 2), _
            "LocalStatus", rowNumber)
        localEvidence = ReadEvidenceReference(ws.Cells(rowNumber, 3), _
            "LocalEvidence", rowNumber)
        cloudStatus = ReadExactStatus(ws.Cells(rowNumber, 4), _
            "CloudStatus", rowNumber)
        cloudEvidence = ReadEvidenceReference(ws.Cells(rowNumber, 5), _
            "CloudEvidence", rowNumber)

        CountStatus localStatus, localPass, localPending, localFail
        CountStatus cloudStatus, cloudPass, cloudPending, cloudFail
    Next rowNumber

    ws.Range("A14:A17").Value = Application.Transpose(Array( _
        "Local control counts", "Local review result", _
        "Cloud control counts", "Cloud review result"))
    ws.Range("B14").Value2 = FormatCounts(localPass, _
        localPending, localFail)
    ws.Range("B15").Value2 = ReviewResult(localPass, _
        localPending, localFail)
    ws.Range("B16").Value2 = FormatCounts(cloudPass, _
        cloudPending, cloudFail)
    ws.Range("B17").Value2 = ReviewResult(cloudPass, _
        cloudPending, cloudFail)
    ws.Range("A14:B17").NumberFormat = "@"

    Application.ScreenUpdating = previousScreenUpdating
    MsgBox "Security control summary created in A14:B17.", _
        vbInformation
    Exit Sub

CleanFail:
    Application.ScreenUpdating = previousScreenUpdating
    MsgBox "Security control review stopped. Error " &amp;amp; Err.Number &amp;amp; _
        ": " &amp;amp; Err.Description, vbExclamation
End Sub

Private Sub ValidateSecurityReviewContract(ByVal ws As Worksheet)
    Dim headers As Variant
    Dim controls As Variant
    Dim columnNumber As Long
    Dim rowNumber As Long

    headers = Array("Control", "LocalStatus", "LocalEvidence", _
        "CloudStatus", "CloudEvidence")
    controls = Array( _
        "Data classification complete", _
        "Data location and processors approved", _
        "Least-privilege access approved", _
        "Encryption requirements approved", _
        "Backup and recovery tested", _
        "Retention and deletion approved", _
        "Logging and audit approved", _
        "Patch and vulnerability process approved", _
        "Incident response owner assigned", _
        "Template and output review approved")

    For columnNumber = 1 To 5
        RequireExactText ws.Cells(1, columnNumber), _
            CStr(headers(columnNumber - 1)), _
            "header " &amp;amp; ws.Cells(1, columnNumber).Address(False, False)
    Next columnNumber

    For rowNumber = FIRST_CONTROL_ROW To LAST_CONTROL_ROW
        RequireExactText ws.Cells(rowNumber, 1), _
            CStr(controls(rowNumber - FIRST_CONTROL_ROW)), _
            "control name in row " &amp;amp; rowNumber
    Next rowNumber
End Sub

Private Sub RequireExactText(ByVal sourceCell As Range, _
                             ByVal expectedText As String, _
                             ByVal fieldLabel As String)
    If sourceCell.HasFormula Then
        RaiseCellError sourceCell, fieldLabel &amp;amp; _
            " must be literal text, not a formula."
    End If
    If IsError(sourceCell.Value2) Then
        RaiseCellError sourceCell, fieldLabel &amp;amp; _
            " contains an Excel error."
    End If
    If VarType(sourceCell.Value2) &amp;lt;&amp;gt; vbString Then
        RaiseCellError sourceCell, fieldLabel &amp;amp; _
            " must be stored as text."
    End If
    If StrComp(CStr(sourceCell.Value2), expectedText, _
               vbBinaryCompare) &amp;lt;&amp;gt; 0 Then
        RaiseCellError sourceCell, "Expected '" &amp;amp; expectedText &amp;amp; "'."
    End If
End Sub

Private Function ReadExactStatus(ByVal sourceCell As Range, _
                                 ByVal fieldName As String, _
                                 ByVal rowNumber As Long) As String
    Dim statusText As String

    If sourceCell.HasFormula Then
        RaiseCellError sourceCell, fieldName &amp;amp; _
            " must be literal text in row " &amp;amp; rowNumber &amp;amp; "."
    End If
    If IsError(sourceCell.Value2) Then
        RaiseCellError sourceCell, fieldName &amp;amp; _
            " contains an Excel error in row " &amp;amp; rowNumber &amp;amp; "."
    End If
    If VarType(sourceCell.Value2) &amp;lt;&amp;gt; vbString Then
        RaiseCellError sourceCell, fieldName &amp;amp; _
            " must be text in row " &amp;amp; rowNumber &amp;amp; "."
    End If

    statusText = CStr(sourceCell.Value2)
    Select Case statusText
        Case "PASS", "PENDING", "FAIL"
            ReadExactStatus = statusText
        Case Else
            RaiseCellError sourceCell, fieldName &amp;amp; _
                " must be exactly PASS, PENDING, or FAIL in row " &amp;amp; _
                rowNumber &amp;amp; "."
    End Select
End Function

Private Function ReadEvidenceReference(ByVal sourceCell As Range, _
                                       ByVal fieldName As String, _
                                       ByVal rowNumber As Long) As String
    Dim evidenceText As String

    If sourceCell.HasFormula Then
        RaiseCellError sourceCell, fieldName &amp;amp; _
            " must be literal text in row " &amp;amp; rowNumber &amp;amp; "."
    End If
    If IsError(sourceCell.Value2) Then
        RaiseCellError sourceCell, fieldName &amp;amp; _
            " contains an Excel error in row " &amp;amp; rowNumber &amp;amp; "."
    End If
    If VarType(sourceCell.Value2) &amp;lt;&amp;gt; vbString Then
        RaiseCellError sourceCell, fieldName &amp;amp; _
            " must be text in row " &amp;amp; rowNumber &amp;amp; "."
    End If

    evidenceText = CStr(sourceCell.Value2)
    If Len(evidenceText) = 0 Or Len(evidenceText) &amp;gt; 500 Then
        RaiseCellError sourceCell, fieldName &amp;amp; _
            " must contain 1 to 500 characters in row " &amp;amp; _
            rowNumber &amp;amp; "."
    End If
    If StrComp(evidenceText, Trim$(evidenceText), _
               vbBinaryCompare) &amp;lt;&amp;gt; 0 Then
        RaiseCellError sourceCell, fieldName &amp;amp; _
            " cannot start or end with spaces in row " &amp;amp; _
            rowNumber &amp;amp; "."
    End If
    If ContainsControlCharacter(evidenceText) Then
        RaiseCellError sourceCell, fieldName &amp;amp; _
            " contains a control character in row " &amp;amp; rowNumber &amp;amp; "."
    End If

    ReadEvidenceReference = evidenceText
End Function

Private Function ContainsControlCharacter(ByVal textValue As String) _
    As Boolean
    Dim characterIndex As Long
    Dim characterCode As Long

    For characterIndex = 1 To Len(textValue)
        characterCode = AscW(Mid$(textValue, characterIndex, 1))
        If characterCode &amp;gt;= 0 And characterCode &amp;lt; 32 Then
            ContainsControlCharacter = True
            Exit Function
        End If
    Next characterIndex
End Function

Private Sub CountStatus(ByVal statusText As String, _
                        ByRef passCount As Long, _
                        ByRef pendingCount As Long, _
                        ByRef failCount As Long)
    Select Case statusText
        Case "PASS": passCount = passCount + 1
        Case "PENDING": pendingCount = pendingCount + 1
        Case "FAIL": failCount = failCount + 1
    End Select
End Sub

Private Function FormatCounts(ByVal passCount As Long, _
                              ByVal pendingCount As Long, _
                              ByVal failCount As Long) As String
    FormatCounts = "PASS=" &amp;amp; passCount &amp;amp; _
        "; PENDING=" &amp;amp; pendingCount &amp;amp; "; FAIL=" &amp;amp; failCount
End Function

Private Function ReviewResult(ByVal passCount As Long, _
                              ByVal pendingCount As Long, _
                              ByVal failCount As Long) As String
    If failCount &amp;gt; 0 Then
        ReviewResult = "FAILED CONTROLS REQUIRE REMEDIATION"
    ElseIf pendingCount &amp;gt; 0 Then
        ReviewResult = "PENDING CONTROLS REQUIRE REVIEW"
    ElseIf passCount = LAST_CONTROL_ROW - FIRST_CONTROL_ROW + 1 Then
        ReviewResult = "READY FOR SECURITY APPROVAL REVIEW"
    Else
        ReviewResult = "CONTROL SUMMARY IS INCOMPLETE"
    End If
End Function

Private Sub RaiseCellError(ByVal sourceCell As Range, _
                           ByVal messageText As String)
    Err.Raise vbObjectError + 6501, , _
        sourceCell.Address(False, False) &amp;amp; ": " &amp;amp; messageText
End Sub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Harden a local workflow before calling it controlled
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Dedicated approved locations
&lt;/h3&gt;

&lt;p&gt;Keep inputs, templates, assets, outputs, and backups in named locations with least-privilege access.&lt;/p&gt;

&lt;h3&gt;
  
  
  Protected endpoints
&lt;/h3&gt;

&lt;p&gt;Maintain supported Windows and Office versions, malware protection, disk encryption, screen lock, and controlled local administrator rights.&lt;/p&gt;

&lt;h3&gt;
  
  
  Approved templates and code
&lt;/h3&gt;

&lt;p&gt;Version templates and VBA, review changes, restrict trusted locations, and test on representative copies before release.&lt;/p&gt;

&lt;h3&gt;
  
  
  Recovery and release
&lt;/h3&gt;

&lt;p&gt;Test backups and partial-run recovery; require document review, signature authorization, metadata checks, and release approval.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Control the downstream copies&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Local generation does not keep data local after users attach outputs to email, upload them to portals, copy them to shared folders, or print them. Include the complete document lifecycle in the review.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use authoritative platform guidance
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://learn.microsoft.com/en-us/microsoft-365-apps/security/internet-macros-blocked" rel="noopener noreferrer"&gt;Microsoft: macros from the internet are blocked&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Review Microsoft’s explanation of macro blocking, trusted publishers, trusted locations, and safer deployment choices before enabling VBA.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.ncsc.gov.uk/collection/cloud/understanding-cloud-services/cloud-security-shared-responsibility-model" rel="noopener noreferrer"&gt;NCSC: cloud shared responsibility&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Use the shared-responsibility model to identify which controls belong to the provider and which remain with the customer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Apply the review to the actual DocxForge Pro module
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Contractor
&lt;/h3&gt;

&lt;p&gt;One case feeds several different Word templates. Protect the case data, template set, case-level assets, generated pack, and release decision.&lt;/p&gt;

&lt;h3&gt;
  
  
  Factory
&lt;/h3&gt;

&lt;p&gt;Many independent Excel rows feed one standard Word template. Protect the workbook, template, image folder, output directory, batch status, and recovery process.&lt;/p&gt;

&lt;h3&gt;
  
  
  Local does not mean single-user
&lt;/h3&gt;

&lt;p&gt;Network shares, remote desktops, synchronized folders, and multiple operators introduce additional access and concurrency controls.&lt;/p&gt;

&lt;h3&gt;
  
  
  Product scope
&lt;/h3&gt;

&lt;p&gt;DocxForge Pro performs local document generation; it does not replace endpoint security, identity management, backups, retention, or compliance approval.&lt;/p&gt;

&lt;h3&gt;
  
  
  Contractor: secure one case and its document pack
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvzk8d0j0u8gia8g3ux45.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvzk8d0j0u8gia8g3ux45.png" alt="DocxForge Pro Contractor case data requiring controlled local access" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Restrict and review the case dataset.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Feb2f6li52wa664alw59l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Feb2f6li52wa664alw59l.png" alt="DocxForge Pro Contractor document selection for an approved case pack" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Approve the templates and released pack.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Factory: secure the batch, template, and outputs
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgumwo4k4k51fnjggobna.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgumwo4k4k51fnjggobna.png" alt="DocxForge Pro Factory spreadsheet rows under local access control" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Control access to batch source rows.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7y2h2aor2sadpxsktj5d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7y2h2aor2sadpxsktj5d.png" alt="DocxForge Pro Factory template and output settings for a controlled batch" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Approve the template, output settings, and review process.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Test the local workflow inside your approved environment&lt;/strong&gt;7 days free, then $38 every 3 months • 14-day refund.&lt;/p&gt;

&lt;p&gt;Local processingControlled templatesDOCX/PDF reviewNo required upload&lt;/p&gt;

&lt;p&gt;Start Free 7-Day Trial&lt;/p&gt;

&lt;h2&gt;
  
  
  Make an architecture decision without security theater
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Choose local when
&lt;/h3&gt;

&lt;p&gt;The data must remain in an approved environment, desktop operation fits the process, and endpoint, storage, recovery, and ownership controls can be sustained.&lt;/p&gt;

&lt;h3&gt;
  
  
  Choose cloud when
&lt;/h3&gt;

&lt;p&gt;Central collaboration, identity, logging, managed resilience, remote access, or elastic throughput are required and the provider and tenant meet the controls.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use a hybrid only deliberately
&lt;/h3&gt;

&lt;p&gt;Define which data crosses the boundary, why, through which approved service, under which credentials, and how copies are retained or deleted.&lt;/p&gt;

&lt;h3&gt;
  
  
  Reassess after change
&lt;/h3&gt;

&lt;p&gt;Repeat the review when users, templates, data classes, storage, remote access, providers, integrations, or retention rules change.&lt;/p&gt;

&lt;p&gt;The worksheet summary is a decision aid. Final approval belongs to the organization’s responsible security, privacy, legal, compliance, IT, and business owners.&lt;/p&gt;

&lt;h2&gt;
  
  
  Continue the security and operating review
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://docxforgepro.com/blog/google-apps-script-vs-desktop-document-automation-for-sensitive-files" rel="noopener noreferrer"&gt;Compare Apps Script and desktop processing&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Review permissions, data movement, scopes, storage, and operating ownership.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://docxforgepro.com/blog/how-to-build-a-local-only-document-workflow-for-sensitive-files" rel="noopener noreferrer"&gt;Design a local-only workflow&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Define storage, access, templates, outputs, review, retention, and recovery.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://docxforgepro.com/blog/shared-drive-templates-vs-managed-output-folders-in-batch-generation" rel="noopener noreferrer"&gt;Control shared templates and outputs&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Separate template governance from managed batch results and recovery.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://docxforgepro.com/blog/excel-word-pdf-workflow-for-compliance-evidence-packs" rel="noopener noreferrer"&gt;Build controlled evidence packs&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Apply source, template, signature, output, and review controls to a practical workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently asked questions
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Is desktop document automation automatically more secure than cloud automation?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No. Local processing can reduce required uploads and third-party processing, but security still depends on endpoint protection, access control, encryption, backups, patching, logging, retention, incident response, and operator behavior.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can a well-managed cloud service be safer than an unmanaged desktop?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Yes. Central identity, MFA, logging, managed patching, resilient infrastructure, and professional operations can make a correctly configured cloud service stronger than an unpatched PC with broad access and weak backups.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What security advantage does local processing provide?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It can keep source files, templates, images, and outputs inside an approved local environment during generation, reducing the number of processors and network transfers required for that workflow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does DocxForge Pro make a workflow compliant?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No. The product performs local document generation. The organization remains responsible for legal requirements, data classification, permissions, encryption, retention, backups, review, release approval, and evidence of control operation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How should Contractor be assessed?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Contractor uses one case to create several different documents. Review the case-data location, every template, access to generated packs, image and signature authorization, retention, and release controls.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How should Factory be assessed?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Factory creates separate repeated documents from many spreadsheet rows through one template. Review batch access, template approval, row-level data quality, output folders, exception handling, logs, and recovery after partial runs.&lt;/p&gt;




&lt;p&gt;This article was prepared with AI assistance.&lt;/p&gt;

</description>
      <category>automation</category>
      <category>vba</category>
      <category>excel</category>
      <category>pdf</category>
    </item>
    <item>
      <title>Can a Local Workflow Beat a Cloud Stack on Rollout Cost?</title>
      <dc:creator>DocxForgePro</dc:creator>
      <pubDate>Sun, 06 Dec 2026 02:27:18 +0000</pubDate>
      <link>https://dev.to/docxforgepro/can-a-local-workflow-beat-a-cloud-stack-on-rollout-cost-2n59</link>
      <guid>https://dev.to/docxforgepro/can-a-local-workflow-beat-a-cloud-stack-on-rollout-cost-2n59</guid>
      <description>&lt;p&gt;Originally published on &lt;a href="https://docxforgepro.com/blog/can-a-local-workflow-beat-a-cloud-stack-on-rollout-cost" rel="noopener noreferrer"&gt;DocxForge Pro&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Rollout Cost Comparison&lt;/p&gt;

&lt;p&gt;Compare local and cloud document automation over the same time horizon, volume, labor rate, support model, and feasibility gates instead of assuming either architecture is automatically cheaper.&lt;/p&gt;

&lt;p&gt;Same time horizon&lt;/p&gt;

&lt;p&gt;Full setup cost&lt;/p&gt;

&lt;p&gt;Monthly run cost&lt;/p&gt;

&lt;p&gt;Feasibility gates&lt;/p&gt;

&lt;p&gt;A lower spreadsheet total is evidence for review, not permission to ignore security, recovery, data-location, ownership, or output-quality requirements.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick answer: local can win, but only under measured assumptions
&lt;/h2&gt;

&lt;p&gt;A local workflow can have the lower rollout cost when Word Desktop and suitable workstations already exist, the process fits a controlled desktop operation, and cloud platform, integration, or usage charges are material. Cloud can be cheaper when collaboration, centralized administration, elastic throughput, or existing platform capacity avoids local setup and support.&lt;/p&gt;

&lt;h3&gt;
  
  
  Compare the same work
&lt;/h3&gt;

&lt;p&gt;Use identical documents, volume, review rules, support scope, and analysis months.&lt;/p&gt;

&lt;h3&gt;
  
  
  Separate initial and recurring cost
&lt;/h3&gt;

&lt;p&gt;Do not hide implementation labor inside a monthly number or ignore ongoing support.&lt;/p&gt;

&lt;h3&gt;
  
  
  Price real usage
&lt;/h3&gt;

&lt;p&gt;Model cloud platform, per-document, storage, integration, and security work using actual quotes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Keep feasibility separate
&lt;/h3&gt;

&lt;p&gt;Reject an option that fails mandatory controls even when its calculated cost is lower.&lt;/p&gt;

&lt;h2&gt;
  
  
  Define one cost contract before comparing architectures
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Time horizon
&lt;/h3&gt;

&lt;p&gt;Choose a review period such as 12, 24, or 36 months and apply it to both options.&lt;/p&gt;

&lt;h3&gt;
  
  
  Document volume
&lt;/h3&gt;

&lt;p&gt;Use representative monthly output, including seasonal peaks and failed or repeated runs where they create charges.&lt;/p&gt;

&lt;h3&gt;
  
  
  Labor boundary
&lt;/h3&gt;

&lt;p&gt;Use a loaded hourly rate and count only work attributable to setup, operation, support, review, and recovery.&lt;/p&gt;

&lt;h3&gt;
  
  
  Decision boundary
&lt;/h3&gt;

&lt;p&gt;Record PASS, PENDING, or FAIL for each architecture after security, recovery, ownership, and technical review.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do not mix sunk and incremental costs&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An existing Office license or workstation may have no incremental purchase cost, but that assumption must be explicit. Add any new Word Desktop licenses, dedicated hardware, backup capacity, administration, or restricted-access storage required by the rollout.&lt;/p&gt;

&lt;h2&gt;
  
  
  Count the full local rollout cost
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Implementation
&lt;/h3&gt;

&lt;p&gt;Template and data preparation, workflow configuration, testing, training, and recovery rehearsal.&lt;/p&gt;

&lt;h3&gt;
  
  
  Software and infrastructure
&lt;/h3&gt;

&lt;p&gt;DocxForge Pro, any incremental Word Desktop licenses, workstations, storage, backup, and access controls.&lt;/p&gt;

&lt;h3&gt;
  
  
  Monthly operation
&lt;/h3&gt;

&lt;p&gt;Support, template maintenance, exception handling, output review, and documented updates.&lt;/p&gt;

&lt;h3&gt;
  
  
  Capacity limits
&lt;/h3&gt;

&lt;p&gt;Desktop throughput, operator availability, maintenance windows, and the cost of splitting large runs.&lt;/p&gt;

&lt;p&gt;DocxForge Pro is not a one-time license in this comparison. The current plan is billed at &lt;strong&gt;$38 every three months&lt;/strong&gt; after the seven-day trial. A monthly model may use $12.67 as a comparison equivalent, while the business case should preserve the actual quarterly billing schedule.&lt;/p&gt;

&lt;h2&gt;
  
  
  Count the full cloud-stack rollout cost
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Platform and usage
&lt;/h3&gt;

&lt;p&gt;Subscription, per-user, per-document, API, storage, egress, logging, and premium support charges.&lt;/p&gt;

&lt;h3&gt;
  
  
  Integration
&lt;/h3&gt;

&lt;p&gt;Authentication, connectors, source-data mapping, deployment, monitoring, testing, and vendor-specific development.&lt;/p&gt;

&lt;h3&gt;
  
  
  Governance
&lt;/h3&gt;

&lt;p&gt;Security assessment, data-processing review, retention configuration, regional hosting, and incident procedures.&lt;/p&gt;

&lt;h3&gt;
  
  
  Operational change
&lt;/h3&gt;

&lt;p&gt;Administration, failed-job handling, rate limits, vendor changes, migration work, and exit planning.&lt;/p&gt;

&lt;p&gt;Do not use a generic cloud price from this article. Enter a current vendor quote and the expected usage tier. A per-document price that looks small can dominate at high volume; an existing enterprise platform can make the opposite result equally plausible.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create RolloutCost in one exact A–B contract
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Labels in A2:A17&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Analysis months; Documents per month; Loaded hourly labor cost; Local setup hours; Local setup cash cost; Local recurring software cost per month; Local support hours per month; Local infrastructure cost; Cloud setup hours; Cloud setup cash cost; Cloud platform cost per month; Cloud per-document cost; Cloud support hours per month; Cloud migration and security cost; Local feasibility status; Cloud feasibility status&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Enter reviewed numeric values in B2:B15. Analysis months and documents per month must be positive whole numbers. Use exact PASS, PENDING, or FAIL in B16:B17. Reserve A19:B27 for calculated results.&lt;/p&gt;

&lt;h3&gt;
  
  
  Initial local cost
&lt;/h3&gt;

&lt;p&gt;Setup labor + setup cash + incremental local infrastructure.&lt;/p&gt;

&lt;h3&gt;
  
  
  Monthly local cost
&lt;/h3&gt;

&lt;p&gt;Recurring local software + additional monthly local support labor.&lt;/p&gt;

&lt;h3&gt;
  
  
  Initial cloud cost
&lt;/h3&gt;

&lt;p&gt;Setup labor + setup cash + migration and security work.&lt;/p&gt;

&lt;h3&gt;
  
  
  Monthly cloud cost
&lt;/h3&gt;

&lt;p&gt;Platform + document volume × per-document charge + monthly cloud support labor.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trace one illustrative 12-month comparison
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Shared assumptions
&lt;/h3&gt;

&lt;p&gt;12 months, 600 documents per month, and a loaded labor cost of $35/hour.&lt;/p&gt;

&lt;h3&gt;
  
  
  Local scenario
&lt;/h3&gt;

&lt;p&gt;28 setup hours, $1,000 setup cash, $500 infrastructure, $12.67 monthly software, and 3 support hours per month produce $3,892.04 total.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cloud scenario
&lt;/h3&gt;

&lt;p&gt;10 setup hours, $250 setup cash, $300 migration/security, $300 monthly platform cost, $0.12 per document, and 5 support hours produce $7,464 total.&lt;/p&gt;

&lt;h3&gt;
  
  
  Interpretation
&lt;/h3&gt;

&lt;p&gt;Local is $3,571.96 lower and recovers its higher initial cost in month 4. These are illustrative inputs—not a universal cloud price or guaranteed saving.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Run sensitivity cases&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Repeat the calculation with low, expected, and peak document volume; higher support effort; a shorter horizon; and current quotes. A decision that reverses after a small input change is not a robust cost advantage.&lt;/p&gt;

&lt;h2&gt;
  
  
  Free VBA helper: compare rollout cost on one sheet
&lt;/h2&gt;

&lt;p&gt;Create &lt;code&gt;RolloutCost&lt;/code&gt;, enter the exact labels and reviewed inputs, reserve A19:B27, and run &lt;code&gt;CompareLocalAndCloudRolloutCost&lt;/code&gt;. The calculator validates literal inputs, separates initial and monthly cost, calculates the selected horizon, reports local cost catch-up when applicable, and refuses to let a failed feasibility gate become a cost recommendation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Excel VBA — local versus cloud cost model&lt;/strong&gt;&lt;strong&gt;Cost comparison, not automatic approval&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Option Explicit

Public Sub CompareLocalAndCloudRolloutCost()
    Dim ws As Worksheet
    Dim analysisMonths As Double, documentsPerMonth As Double
    Dim hourlyCost As Double
    Dim localSetupHours As Double, localSetupCash As Double
    Dim localRecurring As Double, localSupportHours As Double
    Dim localInfrastructure As Double
    Dim cloudSetupHours As Double, cloudSetupCash As Double
    Dim cloudPlatform As Double, cloudPerDocument As Double
    Dim cloudSupportHours As Double, cloudMigration As Double
    Dim localStatus As String, cloudStatus As String
    Dim localInitial As Double, cloudInitial As Double
    Dim localMonthly As Double, cloudMonthly As Double
    Dim localTotal As Double, cloudTotal As Double
    Dim costDifference As Double, breakEven As Variant
    Dim recommendation As String
    Dim previousScreenUpdating As Boolean

    On Error GoTo CleanFail
    previousScreenUpdating = Application.ScreenUpdating
    Application.ScreenUpdating = False

    Set ws = ThisWorkbook.Worksheets("RolloutCost")
    ValidateInputLabels ws

    analysisMonths = PositiveWholeNumber(ws.Range("B2"), _
        "Analysis months")
    documentsPerMonth = PositiveWholeNumber(ws.Range("B3"), _
        "Documents per month")
    hourlyCost = PositiveNumber(ws.Range("B4"), _
        "Loaded hourly labor cost")

    localSetupHours = NonNegativeNumber(ws.Range("B5"), _
        "Local setup hours")
    localSetupCash = NonNegativeNumber(ws.Range("B6"), _
        "Local setup cash cost")
    localRecurring = NonNegativeNumber(ws.Range("B7"), _
        "Local recurring software cost per month")
    localSupportHours = NonNegativeNumber(ws.Range("B8"), _
        "Local support hours per month")
    localInfrastructure = NonNegativeNumber(ws.Range("B9"), _
        "Local infrastructure cost")

    cloudSetupHours = NonNegativeNumber(ws.Range("B10"), _
        "Cloud setup hours")
    cloudSetupCash = NonNegativeNumber(ws.Range("B11"), _
        "Cloud setup cash cost")
    cloudPlatform = NonNegativeNumber(ws.Range("B12"), _
        "Cloud platform cost per month")
    cloudPerDocument = NonNegativeNumber(ws.Range("B13"), _
        "Cloud per-document cost")
    cloudSupportHours = NonNegativeNumber(ws.Range("B14"), _
        "Cloud support hours per month")
    cloudMigration = NonNegativeNumber(ws.Range("B15"), _
        "Cloud migration and security cost")

    localStatus = ExactChoice(ws.Range("B16"), _
        "Local feasibility status", Array("PASS", "PENDING", "FAIL"))
    cloudStatus = ExactChoice(ws.Range("B17"), _
        "Cloud feasibility status", Array("PASS", "PENDING", "FAIL"))

    localInitial = localSetupHours * hourlyCost + _
        localSetupCash + localInfrastructure
    localMonthly = localRecurring + localSupportHours * hourlyCost
    localTotal = localInitial + analysisMonths * localMonthly

    cloudInitial = cloudSetupHours * hourlyCost + _
        cloudSetupCash + cloudMigration
    cloudMonthly = cloudPlatform + _
        documentsPerMonth * cloudPerDocument + _
        cloudSupportHours * hourlyCost
    cloudTotal = cloudInitial + analysisMonths * cloudMonthly

    costDifference = cloudTotal - localTotal
    breakEven = LocalBreakEvenMonth(localInitial, localMonthly, _
        cloudInitial, cloudMonthly, analysisMonths)
    recommendation = CostRecommendation(localStatus, cloudStatus, _
        localTotal, cloudTotal)

    ws.Range("A19:A27").Value = Application.Transpose(Array( _
        "Local initial cost", "Cloud initial cost", _
        "Local monthly run cost", "Cloud monthly run cost", _
        "Local total cost", "Cloud total cost", _
        "Cost difference (cloud minus local)", _
        "Local cost catch-up", "Decision summary"))

    ws.Range("B19").Value2 = localInitial
    ws.Range("B20").Value2 = cloudInitial
    ws.Range("B21").Value2 = localMonthly
    ws.Range("B22").Value2 = cloudMonthly
    ws.Range("B23").Value2 = localTotal
    ws.Range("B24").Value2 = cloudTotal
    ws.Range("B25").Value2 = costDifference
    ws.Range("B26").Value2 = breakEven
    ws.Range("B27").Value2 = recommendation
    ws.Range("B19:B25").NumberFormat = "$#,##0.00"
    ws.Range("B26").NumberFormat = "0"

    Application.ScreenUpdating = previousScreenUpdating
    MsgBox "Rollout cost comparison created in A19:B27.", _
        vbInformation
    Exit Sub

CleanFail:
    Application.ScreenUpdating = previousScreenUpdating
    MsgBox "Rollout cost comparison stopped. Error " &amp;amp; Err.Number &amp;amp; _
        ": " &amp;amp; Err.Description, vbExclamation
End Sub

Private Sub ValidateInputLabels(ByVal ws As Worksheet)
    Dim labels As Variant
    Dim rowNumber As Long

    labels = Array( _
        "Analysis months", "Documents per month", _
        "Loaded hourly labor cost", "Local setup hours", _
        "Local setup cash cost", _
        "Local recurring software cost per month", _
        "Local support hours per month", _
        "Local infrastructure cost", "Cloud setup hours", _
        "Cloud setup cash cost", _
        "Cloud platform cost per month", _
        "Cloud per-document cost", _
        "Cloud support hours per month", _
        "Cloud migration and security cost", _
        "Local feasibility status", "Cloud feasibility status")

    For rowNumber = 2 To 17
        If StrComp(CStr(ws.Cells(rowNumber, 1).Value2), _
                   CStr(labels(rowNumber - 2)), _
                   vbBinaryCompare) &amp;lt;&amp;gt; 0 Then
            Err.Raise vbObjectError + 6400, , _
                "Expected label '" &amp;amp; labels(rowNumber - 2) &amp;amp; _
                "' in A" &amp;amp; rowNumber &amp;amp; "."
        End If
    Next rowNumber
End Sub

Private Function LocalBreakEvenMonth( _
    ByVal localInitial As Double, _
    ByVal localMonthly As Double, _
    ByVal cloudInitial As Double, _
    ByVal cloudMonthly As Double, _
    ByVal analysisMonths As Double) As Variant

    Dim monthlyAdvantage As Double
    Dim exactMonths As Double
    Dim wholeMonths As Long

    If localInitial &amp;lt;= cloudInitial Then
        If localMonthly &amp;lt;= cloudMonthly Then
            LocalBreakEvenMonth = "Local cheaper from start"
        Else
            LocalBreakEvenMonth = _
                "Local starts cheaper; may reverse"
        End If
        Exit Function
    End If

    monthlyAdvantage = cloudMonthly - localMonthly
    If monthlyAdvantage &amp;lt;= 0 Then
        LocalBreakEvenMonth = "Not within horizon"
        Exit Function
    End If

    exactMonths = (localInitial - cloudInitial) / monthlyAdvantage
    wholeMonths = Fix(exactMonths)
    If wholeMonths &amp;lt; exactMonths Then wholeMonths = wholeMonths + 1

    If wholeMonths &amp;lt;= analysisMonths Then
        LocalBreakEvenMonth = wholeMonths
    Else
        LocalBreakEvenMonth = "Not within horizon"
    End If
End Function

Private Function CostRecommendation( _
    ByVal localStatus As String, _
    ByVal cloudStatus As String, _
    ByVal localTotal As Double, _
    ByVal cloudTotal As Double) As String

    If localStatus &amp;lt;&amp;gt; "PASS" And cloudStatus &amp;lt;&amp;gt; "PASS" Then
        CostRecommendation = _
            "RESOLVE FEASIBILITY GATES BEFORE A COST DECISION"
    ElseIf localStatus &amp;lt;&amp;gt; "PASS" Then
        CostRecommendation = "CLOUD IS THE ONLY PASSED OPTION"
    ElseIf cloudStatus &amp;lt;&amp;gt; "PASS" Then
        CostRecommendation = "LOCAL IS THE ONLY PASSED OPTION"
    ElseIf localTotal &amp;lt; cloudTotal Then
        CostRecommendation = "LOCAL COST IS LOWER FOR THIS HORIZON"
    ElseIf cloudTotal &amp;lt; localTotal Then
        CostRecommendation = "CLOUD COST IS LOWER FOR THIS HORIZON"
    Else
        CostRecommendation = "COSTS ARE EQUAL FOR THIS HORIZON"
    End If
End Function

Private Function PositiveWholeNumber(ByVal cell As Range, _
                                     ByVal fieldName As String) As Double
    PositiveWholeNumber = PositiveNumber(cell, fieldName)
    If PositiveWholeNumber &amp;lt;&amp;gt; Fix(PositiveWholeNumber) Then
        RaiseCellError cell, _
            fieldName &amp;amp; " must be a positive whole number."
    End If
End Function

Private Function PositiveNumber(ByVal cell As Range, _
                                ByVal fieldName As String) As Double
    PositiveNumber = NumberValue(cell, fieldName)
    If PositiveNumber &amp;lt;= 0 Then
        RaiseCellError cell, fieldName &amp;amp; " must be greater than zero."
    End If
End Function

Private Function NonNegativeNumber(ByVal cell As Range, _
                                   ByVal fieldName As String) As Double
    NonNegativeNumber = NumberValue(cell, fieldName)
    If NonNegativeNumber &amp;lt; 0 Then
        RaiseCellError cell, fieldName &amp;amp; " cannot be negative."
    End If
End Function

Private Function NumberValue(ByVal cell As Range, _
                             ByVal fieldName As String) As Double
    If cell.HasFormula Or IsError(cell.Value2) Then
        RaiseCellError cell, _
            fieldName &amp;amp; " must be a reviewed numeric input."
    End If

    Select Case VarType(cell.Value2)
        Case vbByte, vbInteger, vbLong, vbSingle, _
             vbDouble, vbCurrency, vbDecimal
        Case Else
            RaiseCellError cell, _
                fieldName &amp;amp; " must be numeric, not text."
    End Select

    NumberValue = CDbl(cell.Value2)
End Function

Private Function ExactChoice(ByVal cell As Range, _
                             ByVal fieldName As String, _
                             ByVal allowedValues As Variant) As String
    Dim item As Variant
    Dim textValue As String

    If cell.HasFormula Or VarType(cell.Value2) &amp;lt;&amp;gt; vbString Then
        RaiseCellError cell, _
            fieldName &amp;amp; " must be reviewed literal text."
    End If

    textValue = CStr(cell.Value2)
    For Each item In allowedValues
        If StrComp(textValue, CStr(item), vbBinaryCompare) = 0 Then
            ExactChoice = textValue
            Exit Function
        End If
    Next item

    RaiseCellError cell, fieldName &amp;amp; " contains an unsupported value."
End Function

Private Sub RaiseCellError(ByVal cell As Range, _
                           ByVal messageText As String)
    Err.Raise vbObjectError + 6401, , _
        cell.Address(False, False) &amp;amp; ": " &amp;amp; messageText
End Sub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Review what the calculator deliberately cannot approve
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Security and data location
&lt;/h3&gt;

&lt;p&gt;Confirm where source files, templates, outputs, logs, credentials, and backups are stored and who can access them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Recovery and ownership
&lt;/h3&gt;

&lt;p&gt;Test interrupted runs and define who owns data, templates, operations, support, review, and incident handling.&lt;/p&gt;

&lt;h3&gt;
  
  
  Throughput and collaboration
&lt;/h3&gt;

&lt;p&gt;Test peak batches, concurrent users, remote work, centralized control, rate limits, and handoffs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Output quality
&lt;/h3&gt;

&lt;p&gt;Review representative DOCX/PDF results, exceptions, images, naming, metadata, and any legally significant content.&lt;/p&gt;

&lt;p&gt;The PASS values in the worksheet are management inputs after review. The macro does not perform a security audit, validate a vendor, test Word Desktop, or certify the generated documents.&lt;/p&gt;

&lt;h2&gt;
  
  
  Model the actual DocxForge Pro workflow
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Contractor
&lt;/h3&gt;

&lt;p&gt;One case supplies several different Word templates. Measure repeated data entry, pack assembly, review, and file handling across the complete case.&lt;/p&gt;

&lt;h3&gt;
  
  
  Factory
&lt;/h3&gt;

&lt;p&gt;Many independent spreadsheet rows use one standard Word template. Measure batch preparation, per-row exceptions, review, and output handling.&lt;/p&gt;

&lt;h3&gt;
  
  
  Do not add overlapping savings
&lt;/h3&gt;

&lt;p&gt;If both modules remove the same manual work, count that benefit once.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use a representative pilot
&lt;/h3&gt;

&lt;p&gt;Measure the chosen module with real templates, ordinary records, edge cases, images, DOCX/PDF output, and recovery.&lt;/p&gt;

&lt;h3&gt;
  
  
  Contractor: one case and several different documents
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvzk8d0j0u8gia8g3ux45.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvzk8d0j0u8gia8g3ux45.png" alt="DocxForge Pro Contractor case data used in a local rollout pilot" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Measure one controlled case dataset.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Feb2f6li52wa664alw59l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Feb2f6li52wa664alw59l.png" alt="DocxForge Pro Contractor document selection for a multi-template case pack" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Measure the different documents assembled for that case.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Factory: many rows and one standard template
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgumwo4k4k51fnjggobna.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgumwo4k4k51fnjggobna.png" alt="DocxForge Pro Factory spreadsheet rows used to measure batch cost" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Measure representative independent rows and exceptions.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7y2h2aor2sadpxsktj5d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7y2h2aor2sadpxsktj5d.png" alt="DocxForge Pro Factory one-template output configuration" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Measure one-template batch generation and output handling.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Measure a local workflow during a seven-day trial&lt;/strong&gt;7 days free, then $38 every 3 months • 14-day refund.&lt;/p&gt;

&lt;p&gt;Local processingReal templatesMeasured supportDOCX/PDF review&lt;/p&gt;

&lt;p&gt;Start Free 7-Day Trial&lt;/p&gt;

&lt;h2&gt;
  
  
  State the assumptions that can reverse the result
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Stable prices
&lt;/h3&gt;

&lt;p&gt;The model assumes the entered recurring and usage prices remain valid throughout the horizon.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stable volume
&lt;/h3&gt;

&lt;p&gt;The model uses one monthly document count and does not automatically model seasonality or growth.&lt;/p&gt;

&lt;h3&gt;
  
  
  Comparable scope
&lt;/h3&gt;

&lt;p&gt;Local and cloud totals must include the same documents, outputs, review, retention, support, and recovery obligations.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cost is not value
&lt;/h3&gt;

&lt;p&gt;Faster collaboration, centralized administration, local control, or avoided risk may matter even when they are not reduced to dollars.&lt;/p&gt;

&lt;p&gt;Record the source and date for every price. Re-run the model when volume, templates, staffing, platform terms, security requirements, or operating ownership changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Build the decision from measured operating evidence
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://docxforgepro.com/blog/how-to-justify-an-excel-to-word-automation-tool-to-management" rel="noopener noreferrer"&gt;Present the management case&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Combine pilot evidence, payback, ownership, recovery, and approval gates.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://docxforgepro.com/blog/when-does-it-make-sense-to-replace-manual-document-assembly" rel="noopener noreferrer"&gt;Check automation readiness&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Confirm process stability and operating readiness before comparing tools.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://docxforgepro.com/blog/the-manual-work-tax-calculating-roi-of-document-automation" rel="noopener noreferrer"&gt;Calculate document-automation ROI&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Measure benefit, investment, payback, and break-even volume.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://docxforgepro.com/blog/google-apps-script-vs-desktop-document-automation-for-sensitive-files" rel="noopener noreferrer"&gt;Compare desktop and cloud controls&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Evaluate permissions, data location, audit requirements, and operating boundaries.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently asked questions
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Is a local workflow always cheaper than a cloud stack?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No. The result depends on setup work, existing Microsoft Office and workstation capacity, document volume, cloud platform and usage charges, support effort, integration, security review, and the comparison period.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Should an existing Microsoft 365 license be counted?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Count only the incremental cost attributable to the proposed workflow, but document the assumption. If additional Word Desktop licenses or dedicated workstations are required, include them in the local model.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How should the DocxForge Pro price be entered?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The plan is billed at $38 every three months after the seven-day trial. For a monthly comparison, use the equivalent recurring amount and keep the real quarterly billing schedule in the management notes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does a lower total cost make an option acceptable?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No. Security, data location, recovery, ownership, support, throughput, template compatibility, and output review must pass separately. The calculator blocks a cost recommendation when the relevant feasibility gate is not PASS.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When is Factory the relevant local workflow?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Use Factory when many independent spreadsheet rows feed one standard Word template and each row produces its own document. Include batch preparation, review, and exception handling in the cost model.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When is Contractor the relevant local workflow?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Use Contractor when one case supplies several different Word templates for a document pack. Measure the repeated entry and review work removed across the whole case, not per identical row.&lt;/p&gt;




&lt;p&gt;This article was prepared with AI assistance.&lt;/p&gt;

</description>
      <category>automation</category>
      <category>vba</category>
      <category>excel</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Batch Convert Excel to PDF with Images (Offline)</title>
      <dc:creator>DocxForgePro</dc:creator>
      <pubDate>Sun, 06 Dec 2026 02:26:37 +0000</pubDate>
      <link>https://dev.to/docxforgepro/batch-convert-excel-to-pdf-with-images-offline-527p</link>
      <guid>https://dev.to/docxforgepro/batch-convert-excel-to-pdf-with-images-offline-527p</guid>
      <description>&lt;p&gt;Originally published on &lt;a href="https://docxforgepro.com/blog/batch-convert-excel-to-pdf-with-images-offline" rel="noopener noreferrer"&gt;DocxForge Pro&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Offline Batch PDF&lt;/p&gt;

&lt;p&gt;Generate up to 100 image-based PDFs per run from validated Excel rows, one Word template, local image files, and a resumable status queue.&lt;/p&gt;

&lt;p&gt;Local processing&lt;/p&gt;

&lt;p&gt;100 PDFs per run&lt;/p&gt;

&lt;p&gt;Two image slots&lt;/p&gt;

&lt;p&gt;Resumable queue&lt;/p&gt;

&lt;p&gt;This is Factory logic. The example creates PDF-only final output; temporary DOCX files remain inside the controlled run folder only until export succeeds.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick answer: use Excel as a local PDF queue
&lt;/h2&gt;

&lt;p&gt;Each READY row contains the document text, two approved image filenames, and one unique output name. The macro validates the complete queue, snapshots the Word template and image files, creates up to 100 PDFs, saves DONE after each successful file, and leaves the remaining rows READY.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Offline describes the processing path, not every storage location&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The VBA does not upload files. Windows backup tools, synchronized folders, email software, or another process can still copy them elsewhere. Use approved local folders and access controls when locality is required.&lt;/p&gt;

&lt;h2&gt;
  
  
  Define what offline must mean for the batch
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Local applications
&lt;/h3&gt;

&lt;p&gt;Excel and Word Desktop run on the same Windows computer and use local COM automation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Local inputs
&lt;/h3&gt;

&lt;p&gt;The workbook, template, and image assets sit in approved folders beside the workbook.&lt;/p&gt;

&lt;h3&gt;
  
  
  Local output
&lt;/h3&gt;

&lt;p&gt;Run folders, temporary DOCX files, and completed PDFs stay under &lt;code&gt;GeneratedImagePdfs&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  No hidden guarantee
&lt;/h3&gt;

&lt;p&gt;The macro cannot detect every sync client, backup agent, endpoint tool, or user action outside its process.&lt;/p&gt;

&lt;h3&gt;
  
  
  Access control
&lt;/h3&gt;

&lt;p&gt;Restrict the source workbook, images, template snapshots, and PDFs to authorized users.&lt;/p&gt;

&lt;h3&gt;
  
  
  Operational review
&lt;/h3&gt;

&lt;p&gt;Confirm storage, retention, release, and deletion rules before treating a local folder as an approved records location.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create PdfQueue in one exact A–M order
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Required headers in row 1&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;A — DocumentID; B — RecordName; C — Category; D — DocumentDateDisplay; E — PreparedBy; F — StatusDisplay; G — BodyText; H — Image1File; I — Image1Caption; J — Image2File; K — Image2Caption; L — OutputName; M — QueueStatus&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Document identity
&lt;/h3&gt;

&lt;p&gt;Every nonblank row, including HOLD and DONE, needs a unique DocumentID stored as text and a unique OutputName.&lt;/p&gt;

&lt;h3&gt;
  
  
  Document-ready text
&lt;/h3&gt;

&lt;p&gt;Store the reviewed name, category, date, preparer, and display status exactly as Word should receive them. BodyText is one line; CR/LF, tabs, and other control characters are rejected.&lt;/p&gt;

&lt;h3&gt;
  
  
  Fixed image contract
&lt;/h3&gt;

&lt;p&gt;Every READY row requires two distinct filename-only images and two captions.&lt;/p&gt;

&lt;h3&gt;
  
  
  PDF filename
&lt;/h3&gt;

&lt;p&gt;OutputName is a Windows-safe stem without &lt;code&gt;.docx&lt;/code&gt; or &lt;code&gt;.pdf&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Exact queue state
&lt;/h3&gt;

&lt;p&gt;Use READY, HOLD, or DONE with exact capitalization. The macro processes only READY rows.&lt;/p&gt;

&lt;h3&gt;
  
  
  Resume behavior
&lt;/h3&gt;

&lt;p&gt;DONE rows are skipped. If more than 100 rows are READY, the rest remain READY for the next run.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep image selection inside one approved folder
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Filename-only values
&lt;/h3&gt;

&lt;p&gt;Use values such as &lt;code&gt;DOC-0042-A.jpg&lt;/code&gt;, never absolute paths, URLs, wildcards, or &lt;code&gt;..&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Approved directory
&lt;/h3&gt;

&lt;p&gt;Place reviewed PNG, JPG, and JPEG files in &lt;code&gt;Assets\Photos&lt;/code&gt; beside the workbook.&lt;/p&gt;

&lt;h3&gt;
  
  
  Distinct slots
&lt;/h3&gt;

&lt;p&gt;Image1File and Image2File must differ so one image is not silently repeated in both positions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Nonempty files
&lt;/h3&gt;

&lt;p&gt;Every image must exist and have a nonzero size before Word starts.&lt;/p&gt;

&lt;h3&gt;
  
  
  Snapshot copy
&lt;/h3&gt;

&lt;p&gt;Each unique used image is copied once into the run-specific &lt;code&gt;InputSnapshot\Photos&lt;/code&gt; folder.&lt;/p&gt;

&lt;h3&gt;
  
  
  Evidence boundary
&lt;/h3&gt;

&lt;p&gt;Presence, extension, size, and copying do not prove authenticity, authorization, or the visible subject.&lt;/p&gt;

&lt;h2&gt;
  
  
  Build one Word template for the whole queue
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Text bookmarks
&lt;/h3&gt;

&lt;p&gt;DocumentID, RecordName, Category, DocumentDateDisplay, PreparedBy, StatusDisplay, and BodyText.&lt;/p&gt;

&lt;h3&gt;
  
  
  Image bookmarks
&lt;/h3&gt;

&lt;p&gt;Image1 and Image2 with corresponding Image1Caption and Image2Caption bookmarks.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stable text ranges
&lt;/h3&gt;

&lt;p&gt;Keep fields, content controls, existing images, paragraph marks, and table markers outside the text bookmarks.&lt;/p&gt;

&lt;h3&gt;
  
  
  Stable image ranges
&lt;/h3&gt;

&lt;p&gt;Give each image an empty insertion bookmark inside a layout that can contain portrait and landscape images.&lt;/p&gt;

&lt;h3&gt;
  
  
  Clean review state
&lt;/h3&gt;

&lt;p&gt;Turn off Track Changes, resolve revisions in every Word story, and remove comments.&lt;/p&gt;

&lt;h3&gt;
  
  
  PDF test set
&lt;/h3&gt;

&lt;p&gt;Test long values, both image orientations, page breaks, headers, footers, and metadata before approving the template.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use a bounded, resumable batch instead of one endless run
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Full preflight
&lt;/h3&gt;

&lt;p&gt;Validate all queue identities and READY image files, then check staging and final paths for the first 100 planned PDFs before opening Word.&lt;/p&gt;

&lt;h3&gt;
  
  
  Run limit
&lt;/h3&gt;

&lt;p&gt;Generate at most 100 PDFs per run so failures and review remain manageable.&lt;/p&gt;

&lt;h3&gt;
  
  
  Input snapshot
&lt;/h3&gt;

&lt;p&gt;Copy the approved template and images referenced by the first 100 planned PDFs into the run folder before generation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Row recheck
&lt;/h3&gt;

&lt;p&gt;Compare all A–M values with the preflight snapshot immediately before generating each PDF.&lt;/p&gt;

&lt;h3&gt;
  
  
  Per-file checkpoint
&lt;/h3&gt;

&lt;p&gt;After moving one nonempty PDF into Completed, set that row to DONE and save Excel.&lt;/p&gt;

&lt;h3&gt;
  
  
  Safe resume
&lt;/h3&gt;

&lt;p&gt;If a run stops, inspect the retained run folder and statuses before running the remaining READY rows.&lt;/p&gt;

&lt;h2&gt;
  
  
  Free Excel VBA example: generate image-based PDFs offline
&lt;/h2&gt;

&lt;p&gt;Save the workbook as &lt;code&gt;.xlsm&lt;/code&gt;. Create &lt;code&gt;PdfQueue&lt;/code&gt; with the exact A–M headers above. Put &lt;code&gt;ImagePdfTemplate.docx&lt;/code&gt; in &lt;code&gt;Templates&lt;/code&gt;, store approved images in &lt;code&gt;Assets\Photos&lt;/code&gt;, and run &lt;code&gt;GenerateOfflineImagePdfBatch&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Excel VBA — bounded offline PDF batch&lt;/strong&gt;&lt;strong&gt;Factory logic&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Option Explicit

Private Const DATA_SHEET As String = "PdfQueue"
Private Const READY_STATUS As String = "READY"
Private Const HOLD_STATUS As String = "HOLD"
Private Const DONE_STATUS As String = "DONE"
Private Const WORD_FORMAT_XML_DOCUMENT As Long = 12
Private Const WORD_EXPORT_FORMAT_PDF As Long = 17
Private Const WORD_EXPORT_OPTIMIZE_FOR_PRINT As Long = 0
Private Const WORD_EXPORT_ALL_DOCUMENT As Long = 0
Private Const WORD_EXPORT_DOCUMENT_CONTENT As Long = 0
Private Const WORD_EXPORT_CREATE_NO_BOOKMARKS As Long = 0
Private Const WORD_DO_NOT_SAVE_CHANGES As Long = 0
Private Const WORD_ALERTS_NONE As Long = 0
Private Const WORD_COLLAPSE_START As Long = 1
Private Const OFFICE_TRUE As Long = -1
Private Const POINTS_PER_CM As Double = 28.3464567
Private Const MAX_PHOTO_WIDTH_CM As Double = 12#
Private Const MAX_PHOTO_HEIGHT_CM As Double = 8#
Private Const MAX_PDFS_PER_RUN As Long = 100

Public Sub GenerateOfflineImagePdfBatch()
    Dim wb As Workbook
    Dim ws As Worksheet
    Dim fso As Object
    Dim wdApp As Object
    Dim wdDoc As Object
    Dim templatePath As String
    Dim photoFolder As String
    Dim outputRoot As String
    Dim runFolder As String
    Dim inputSnapshotFolder As String
    Dim photoSnapshotFolder As String
    Dim templateSnapshotPath As String
    Dim sourcePhotoPath As String
    Dim snapshotPhotoPath As String
    Dim stagingFolder As String
    Dim completedFolder As String
    Dim tempDocxPath As String
    Dim tempPdfPath As String
    Dim finalPdfPath As String
    Dim data As Variant
    Dim image1Paths() As String
    Dim image2Paths() As String
    Dim lastRow As Long
    Dim dataRow As Long
    Dim excelRow As Long
    Dim readyCount As Long
    Dim plannedCount As Long
    Dim generatedCount As Long
    Dim remainingCount As Long
    Dim documentId As String
    Dim recordName As String
    Dim category As String
    Dim documentDateDisplay As String
    Dim preparedBy As String
    Dim statusDisplay As String
    Dim bodyText As String
    Dim image1File As String
    Dim image1Caption As String
    Dim image2File As String
    Dim image2Caption As String
    Dim outputName As String
    Dim queueStatus As String
    Dim documentIds As Object
    Dim outputNames As Object
    Dim photoSnapshots As Object
    Dim previousScreenUpdating As Boolean
    Dim previousEnableEvents As Boolean
    Dim appStateCaptured As Boolean
    Dim currentStep As String
    Dim errorNumber As Long
    Dim errorDescription As String
    Dim statusSavePending As Boolean
    Dim statusRow As Long
    Dim statusRecoveryMessage As String

    On Error GoTo CleanFail

    Set wb = ThisWorkbook
    previousScreenUpdating = Application.ScreenUpdating
    previousEnableEvents = Application.EnableEvents
    appStateCaptured = True
    Application.ScreenUpdating = False
    Application.EnableEvents = False

    currentStep = "checking the macro-enabled workbook"
    RequireWritableMacroWorkbook wb
    Set ws = wb.Worksheets(DATA_SHEET)
    If ws.ProtectContents Then
        Err.Raise vbObjectError + 5000, , _
            "The PdfQueue sheet is protected against status updates."
    End If
    ValidateHeaders ws
    lastRow = FindLastDataRow(ws)
    If lastRow &amp;lt; 2 Then
        Err.Raise vbObjectError + 5001, , _
            "No image PDF records were found below row 1."
    End If

    templatePath = JoinPath(JoinPath(wb.Path, "Templates"), _
        "ImagePdfTemplate.docx")
    photoFolder = JoinPath(JoinPath(wb.Path, "Assets"), _
        "Photos")
    outputRoot = JoinPath(wb.Path, "GeneratedImagePdfs")
    RequireNonemptyFile templatePath, "image PDF template"
    RequireFolder photoFolder, "photo asset folder"

    data = ws.Range("A2:M" &amp;amp; lastRow).Value2
    ReDim image1Paths(1 To UBound(data, 1))
    ReDim image2Paths(1 To UBound(data, 1))
    Set documentIds = CreateObject("Scripting.Dictionary")
    documentIds.CompareMode = vbTextCompare
    Set outputNames = CreateObject("Scripting.Dictionary")
    outputNames.CompareMode = vbTextCompare

    currentStep = "preflighting Excel image PDF rows"
    For dataRow = 1 To UBound(data, 1)
        excelRow = dataRow + 1
        If Not DataRowIsBlank(data, dataRow) Then
            queueStatus = ReadRequiredText(data(dataRow, 13), _
                "QueueStatus", excelRow)
            ValidateStatus queueStatus, excelRow
            documentId = ReadRequiredText(data(dataRow, 1), _
                "DocumentID", excelRow)
            outputName = ReadRequiredText(data(dataRow, 12), _
                "OutputName", excelRow)
            ValidateIdentifier documentId, "DocumentID", excelRow
            ValidateFileStem outputName, excelRow
            AddUniqueValue documentIds, documentId, _
                "DocumentID", excelRow
            AddUniqueValue outputNames, outputName, _
                "OutputName", excelRow

            If StrComp(queueStatus, READY_STATUS, _
               vbBinaryCompare) = 0 Then
                recordName = ReadRequiredText(data(dataRow, 2), _
                    "RecordName", excelRow)
                category = ReadRequiredText(data(dataRow, 3), _
                    "Category", excelRow)
                documentDateDisplay = ReadRequiredText(data(dataRow, 4), _
                    "DocumentDateDisplay", excelRow)
                preparedBy = ReadRequiredText(data(dataRow, 5), _
                    "PreparedBy", excelRow)
                statusDisplay = ReadRequiredText(data(dataRow, 6), _
                    "StatusDisplay", excelRow)
                bodyText = ReadRequiredText(data(dataRow, 7), _
                    "BodyText", excelRow)
                image1File = ReadRequiredText(data(dataRow, 8), _
                    "Image1File", excelRow)
                image1Caption = ReadRequiredText(data(dataRow, 9), _
                    "Image1Caption", excelRow)
                image2File = ReadRequiredText(data(dataRow, 10), _
                    "Image2File", excelRow)
                image2Caption = ReadRequiredText(data(dataRow, 11), _
                    "Image2Caption", excelRow)
                ValidateStatusDisplay statusDisplay, excelRow
                If StrComp(image1File, image2File, vbTextCompare) = 0 Then
                    Err.Raise vbObjectError + 5055, , _
                        "Image1File and Image2File must be different on row " &amp;amp; _
                        excelRow &amp;amp; "."
                End If
                ValidateImageFileName image1File, "Image1File", excelRow
                ValidateImageFileName image2File, "Image2File", excelRow
                image1Paths(dataRow) = JoinPath(photoFolder, image1File)
                image2Paths(dataRow) = JoinPath(photoFolder, image2File)
                RequireNonemptyFile image1Paths(dataRow), _
                    "first photo for row " &amp;amp; excelRow
                RequireNonemptyFile image2Paths(dataRow), _
                    "second photo for row " &amp;amp; excelRow

                readyCount = readyCount + 1
            End If
        End If
    Next dataRow

    If readyCount = 0 Then
        Err.Raise vbObjectError + 5002, , _
            "No image PDF rows are marked exactly READY."
    End If

    currentStep = "saving the preflighted Excel workbook"
    wb.Save

    Set fso = CreateObject("Scripting.FileSystemObject")
    EnsureFolder outputRoot
    runFolder = CreateRunFolder(fso, outputRoot)
    inputSnapshotFolder = JoinPath(runFolder, "InputSnapshot")
    photoSnapshotFolder = JoinPath(inputSnapshotFolder, "Photos")
    stagingFolder = JoinPath(runFolder, "Staging")
    completedFolder = JoinPath(runFolder, "Completed")
    fso.CreateFolder inputSnapshotFolder
    fso.CreateFolder photoSnapshotFolder
    fso.CreateFolder stagingFolder
    fso.CreateFolder completedFolder

    currentStep = "creating the controlled input snapshot"
    templateSnapshotPath = JoinPath(inputSnapshotFolder, _
        "ImagePdfTemplate.docx")
    CopyFileToSnapshot fso, templatePath, templateSnapshotPath, _
        "image PDF template"
    Set photoSnapshots = CreateObject("Scripting.Dictionary")
    photoSnapshots.CompareMode = vbTextCompare
    plannedCount = 0
    For dataRow = 1 To UBound(data, 1)
        queueStatus = CStr(data(dataRow, 13))
        If StrComp(queueStatus, READY_STATUS, _
           vbBinaryCompare) = 0 Then
            If plannedCount &amp;gt;= MAX_PDFS_PER_RUN Then Exit For
            plannedCount = plannedCount + 1
            image1File = CStr(data(dataRow, 8))
            If Not photoSnapshots.Exists(image1File) Then
                sourcePhotoPath = image1Paths(dataRow)
                snapshotPhotoPath = JoinPath( _
                    photoSnapshotFolder, image1File)
                CopyFileToSnapshot fso, sourcePhotoPath, _
                    snapshotPhotoPath, _
                    "photo " &amp;amp; image1File
                photoSnapshots.Add image1File, _
                    snapshotPhotoPath
            End If
            image1Paths(dataRow) = photoSnapshots(image1File)

            image2File = CStr(data(dataRow, 10))
            If Not photoSnapshots.Exists(image2File) Then
                sourcePhotoPath = image2Paths(dataRow)
                snapshotPhotoPath = JoinPath( _
                    photoSnapshotFolder, image2File)
                CopyFileToSnapshot fso, sourcePhotoPath, _
                    snapshotPhotoPath, _
                    "photo " &amp;amp; image2File
                photoSnapshots.Add image2File, _
                    snapshotPhotoPath
            End If
            image2Paths(dataRow) = photoSnapshots(image2File)
        End If
    Next dataRow

    currentStep = "checking planned output paths before Word starts"
    plannedCount = 0
    For dataRow = 1 To UBound(data, 1)
        queueStatus = CStr(data(dataRow, 13))
        If StrComp(queueStatus, READY_STATUS, _
           vbBinaryCompare) = 0 Then
            If plannedCount &amp;gt;= MAX_PDFS_PER_RUN Then Exit For
            plannedCount = plannedCount + 1
            outputName = CStr(data(dataRow, 12))
            tempDocxPath = JoinPath(stagingFolder, outputName &amp;amp; ".docx")
            tempPdfPath = JoinPath(stagingFolder, outputName &amp;amp; ".pdf")
            finalPdfPath = JoinPath(completedFolder, outputName &amp;amp; ".pdf")
            RequireTargetAbsent tempDocxPath
            RequireTargetAbsent tempPdfPath
            RequireTargetAbsent finalPdfPath
        End If
    Next dataRow

    currentStep = "starting Microsoft Word Desktop"
    Set wdApp = CreateObject("Word.Application")
    wdApp.Visible = False
    wdApp.DisplayAlerts = WORD_ALERTS_NONE
    wdApp.ScreenUpdating = False

    currentStep = "validating the image PDF template snapshot"
    Set wdDoc = wdApp.Documents.Open( _
        templateSnapshotPath, False, True, False)
    ValidateImagePdfTemplate wdDoc
    wdDoc.Close WORD_DO_NOT_SAVE_CHANGES
    Set wdDoc = Nothing

    For dataRow = 1 To UBound(data, 1)
        excelRow = dataRow + 1
        queueStatus = CStr(data(dataRow, 13))
        If StrComp(queueStatus, READY_STATUS, _
           vbBinaryCompare) = 0 Then
            If generatedCount &amp;gt;= MAX_PDFS_PER_RUN Then Exit For
            currentStep = "rechecking Excel row " &amp;amp; excelRow
            RequireRowUnchanged ws, excelRow, data, dataRow

            documentId = CStr(data(dataRow, 1))
            recordName = CStr(data(dataRow, 2))
            category = CStr(data(dataRow, 3))
            documentDateDisplay = CStr(data(dataRow, 4))
            preparedBy = CStr(data(dataRow, 5))
            statusDisplay = CStr(data(dataRow, 6))
            bodyText = CStr(data(dataRow, 7))
            image1Caption = CStr(data(dataRow, 9))
            image2Caption = CStr(data(dataRow, 11))
            outputName = CStr(data(dataRow, 12))

            tempDocxPath = JoinPath(stagingFolder, outputName &amp;amp; ".docx")
            tempPdfPath = JoinPath(stagingFolder, outputName &amp;amp; ".pdf")
            finalPdfPath = JoinPath(completedFolder, outputName &amp;amp; ".pdf")
            RequireTargetAbsent tempDocxPath
            RequireTargetAbsent tempPdfPath
            RequireTargetAbsent finalPdfPath

            currentStep = "generating image PDF row " &amp;amp; excelRow
            Set wdDoc = wdApp.Documents.Open( _
                templateSnapshotPath, False, True, False)
            WriteRequiredBookmark wdDoc, "DocumentID", documentId
            WriteRequiredBookmark wdDoc, "RecordName", recordName
            WriteRequiredBookmark wdDoc, "Category", category
            WriteRequiredBookmark wdDoc, "DocumentDateDisplay", _
                documentDateDisplay
            WriteRequiredBookmark wdDoc, "PreparedBy", preparedBy
            WriteRequiredBookmark wdDoc, "StatusDisplay", statusDisplay
            WriteRequiredBookmark wdDoc, "BodyText", bodyText
            InsertPhotoBookmark wdDoc, "Image1", _
                image1Paths(dataRow)
            WriteRequiredBookmark wdDoc, "Image1Caption", image1Caption
            InsertPhotoBookmark wdDoc, "Image2", _
                image2Paths(dataRow)
            WriteRequiredBookmark wdDoc, "Image2Caption", image2Caption
            ValidateImagePdfResultBeforeSave wdDoc

            wdDoc.SaveAs2 tempDocxPath, WORD_FORMAT_XML_DOCUMENT
            wdDoc.ExportAsFixedFormat _
                tempPdfPath, _
                WORD_EXPORT_FORMAT_PDF, _
                False, _
                WORD_EXPORT_OPTIMIZE_FOR_PRINT, _
                WORD_EXPORT_ALL_DOCUMENT, _
                1, _
                1, _
                WORD_EXPORT_DOCUMENT_CONTENT, _
                True, _
                True, _
                WORD_EXPORT_CREATE_NO_BOOKMARKS, _
                True, _
                True, _
                False
            wdDoc.Close WORD_DO_NOT_SAVE_CHANGES
            Set wdDoc = Nothing

            RequireNonemptyFile tempDocxPath, _
                "staged DOCX for row " &amp;amp; excelRow
            RequireNonemptyFile tempPdfPath, _
                "staged PDF for row " &amp;amp; excelRow
            RequireTargetAbsent finalPdfPath
            Kill tempDocxPath
            Name tempPdfPath As finalPdfPath

            currentStep = "saving DONE for image PDF row " &amp;amp; excelRow
            statusRow = excelRow
            statusSavePending = True
            ws.Cells(excelRow, 13).Value2 = DONE_STATUS
            wb.Save
            statusSavePending = False
            generatedCount = generatedCount + 1
        End If
    Next dataRow

    wdApp.NormalTemplate.Saved = True
    wdApp.Quit WORD_DO_NOT_SAVE_CHANGES
    Set wdApp = Nothing

    Application.EnableEvents = previousEnableEvents
    Application.ScreenUpdating = previousScreenUpdating
    appStateCaptured = False
    remainingCount = readyCount - generatedCount

    MsgBox "Image PDF batch completed." &amp;amp; vbCrLf &amp;amp; _
        "Image PDFs generated: " &amp;amp; generatedCount &amp;amp; vbCrLf &amp;amp; _
        "READY rows remaining: " &amp;amp; remainingCount &amp;amp; vbCrLf &amp;amp; _
        "Completed folder: " &amp;amp; completedFolder &amp;amp; vbCrLf &amp;amp; vbCrLf &amp;amp; _
        "Review source data, both images, and every PDF before release.", _
        vbInformation

CleanExit:
    On Error Resume Next
    If Not wdDoc Is Nothing Then _
        wdDoc.Close WORD_DO_NOT_SAVE_CHANGES
    If Not wdApp Is Nothing Then
        wdApp.NormalTemplate.Saved = True
        wdApp.Quit WORD_DO_NOT_SAVE_CHANGES
    End If
    If appStateCaptured Then
        Application.EnableEvents = previousEnableEvents
        Application.ScreenUpdating = previousScreenUpdating
    End If
    Set wdDoc = Nothing
    Set wdApp = Nothing
    Set fso = Nothing
    Set photoSnapshots = Nothing
    Set ws = Nothing
    Set wb = Nothing
    On Error GoTo 0
    Exit Sub

CleanFail:
    errorNumber = Err.Number
    errorDescription = Err.Description
    On Error Resume Next
    If statusSavePending And Not ws Is Nothing Then
        ws.Cells(statusRow, 13).Value2 = queueStatus
        statusRecoveryMessage = vbCrLf &amp;amp; _
            "DONE was restored to " &amp;amp; queueStatus &amp;amp; _
            " in memory because the workbook save was not confirmed."
    End If
    If Not wdDoc Is Nothing Then _
        wdDoc.Close WORD_DO_NOT_SAVE_CHANGES
    If Not wdApp Is Nothing Then
        wdApp.NormalTemplate.Saved = True
        wdApp.Quit WORD_DO_NOT_SAVE_CHANGES
    End If
    If appStateCaptured Then
        Application.EnableEvents = previousEnableEvents
        Application.ScreenUpdating = previousScreenUpdating
    End If
    Set wdDoc = Nothing
    Set wdApp = Nothing
    Set fso = Nothing
    Set photoSnapshots = Nothing
    Set ws = Nothing
    Set wb = Nothing
    On Error GoTo 0

    MsgBox "Image PDF generation stopped while " &amp;amp; currentStep &amp;amp; "." &amp;amp; _
        vbCrLf &amp;amp; "Error " &amp;amp; errorNumber &amp;amp; ": " &amp;amp; errorDescription &amp;amp; _
        vbCrLf &amp;amp; IIf(Len(runFolder) &amp;gt; 0, _
            "Inspect the retained run folder: " &amp;amp; runFolder, _
            "No run folder was created.") &amp;amp; vbCrLf &amp;amp; _
        "Existing completed files were not deleted." &amp;amp; _
        statusRecoveryMessage, vbCritical
End Sub

Private Sub CopyFileToSnapshot(ByVal fso As Object, _
                               ByVal sourcePath As String, _
                               ByVal snapshotPath As String, _
                               ByVal fileLabel As String)
    Dim sourceSize As Variant
    Dim sourceModified As Date
    Dim errorDescription As String

    RequireNonemptyFile sourcePath, fileLabel
    RequireTargetAbsent snapshotPath
    On Error GoTo CopyFailed
    sourceSize = fso.GetFile(sourcePath).Size
    sourceModified = fso.GetFile(sourcePath).DateLastModified
    fso.CopyFile sourcePath, snapshotPath, False
    RequireNonemptyFile snapshotPath, fileLabel &amp;amp; " snapshot"
    If fso.GetFile(snapshotPath).Size &amp;lt;&amp;gt; sourceSize Then
        Err.Raise vbObjectError + 5046, , _
            "Snapshot size differs from the source " &amp;amp; fileLabel &amp;amp; "."
    End If
    If fso.GetFile(sourcePath).Size &amp;lt;&amp;gt; sourceSize Or _
       fso.GetFile(sourcePath).DateLastModified &amp;lt;&amp;gt; sourceModified Then
        Err.Raise vbObjectError + 5047, , _
            "The source " &amp;amp; fileLabel &amp;amp; _
            " changed while its run snapshot was being created."
    End If
    Exit Sub
CopyFailed:
    errorDescription = Err.Description
    Err.Raise vbObjectError + 5048, , _
        "Could not create the controlled " &amp;amp; fileLabel &amp;amp; _
        " snapshot: " &amp;amp; errorDescription
End Sub

Private Sub RequireWritableMacroWorkbook(ByVal wb As Workbook)
    If Len(wb.Path) = 0 Then
        Err.Raise vbObjectError + 5003, , _
            "Save the Excel workbook before generation."
    End If
    If LCase$(Right$(wb.Name, 5)) &amp;lt;&amp;gt; ".xlsm" Then
        Err.Raise vbObjectError + 5004, , _
            "Save the workbook as an Excel Macro-Enabled Workbook (.xlsm)."
    End If
    If wb.ReadOnly Then
        Err.Raise vbObjectError + 5005, , _
            "The Excel workbook is read-only; DONE statuses cannot be saved."
    End If
End Sub

Private Sub ValidateHeaders(ByVal ws As Worksheet)
    Dim expected As Variant
    Dim columnIndex As Long
    Dim actualText As String

    expected = Array("DocumentID", "RecordName", "Category", _
        "DocumentDateDisplay", "PreparedBy", "StatusDisplay", _
        "BodyText", "Image1File", "Image1Caption", _
        "Image2File", "Image2Caption", "OutputName", "QueueStatus")
    For columnIndex = 1 To 13
        If IsError(ws.Cells(1, columnIndex).Value2) Then
            Err.Raise vbObjectError + 5006, , _
                "Header cell " &amp;amp; ws.Cells(1, columnIndex).Address(False, False) &amp;amp; _
                " contains an Excel error."
        End If
        If VarType(ws.Cells(1, columnIndex).Value2) &amp;lt;&amp;gt; vbString Then
            Err.Raise vbObjectError + 5007, , _
                "Header cell " &amp;amp; ws.Cells(1, columnIndex).Address(False, False) &amp;amp; _
                " must contain exact text."
        End If
        actualText = CStr(ws.Cells(1, columnIndex).Value2)
        If StrComp(actualText, CStr(expected(columnIndex - 1)), _
           vbBinaryCompare) &amp;lt;&amp;gt; 0 Then
            Err.Raise vbObjectError + 5008, , _
                "Expected header " &amp;amp; expected(columnIndex - 1) &amp;amp; _
                " in column " &amp;amp; columnIndex &amp;amp; ", found " &amp;amp; actualText &amp;amp; "."
        End If
    Next columnIndex
End Sub

Private Function FindLastDataRow(ByVal ws As Worksheet) As Long
    Dim lastCell As Range

    Set lastCell = ws.Range("A:M").Find( _
        What:="*", _
        After:=ws.Cells(1, 1), _
        LookIn:=xlFormulas, _
        LookAt:=xlPart, _
        SearchOrder:=xlByRows, _
        SearchDirection:=xlPrevious, _
        MatchCase:=False)
    If lastCell Is Nothing Then
        FindLastDataRow = 0
    Else
        FindLastDataRow = lastCell.Row
    End If
End Function

Private Function DataRowIsBlank(ByRef data As Variant, _
                                ByVal dataRow As Long) As Boolean
    Dim columnIndex As Long

    DataRowIsBlank = True
    For columnIndex = 1 To 13
        If IsError(data(dataRow, columnIndex)) Then
            DataRowIsBlank = False
            Exit Function
        End If
        If Len(CStr(data(dataRow, columnIndex))) &amp;gt; 0 Then
            DataRowIsBlank = False
            Exit Function
        End If
    Next columnIndex
End Function

Private Function ReadRequiredText(ByVal rawValue As Variant, _
                                  ByVal fieldName As String, _
                                  ByVal excelRow As Long) As String
    If IsError(rawValue) Then
        Err.Raise vbObjectError + 5009, , _
            fieldName &amp;amp; " contains an Excel error on row " &amp;amp; excelRow &amp;amp; "."
    End If
    If VarType(rawValue) &amp;lt;&amp;gt; vbString Then
        Err.Raise vbObjectError + 5010, , _
            fieldName &amp;amp; " must be stored as text on row " &amp;amp; excelRow &amp;amp; "."
    End If
    ReadRequiredText = CStr(rawValue)
    If Len(ReadRequiredText) = 0 Then
        Err.Raise vbObjectError + 5011, , _
            fieldName &amp;amp; " is blank on row " &amp;amp; excelRow &amp;amp; "."
    End If
    If ReadRequiredText &amp;lt;&amp;gt; Trim$(ReadRequiredText) Then
        Err.Raise vbObjectError + 5012, , _
            fieldName &amp;amp; " has outer whitespace on row " &amp;amp; excelRow &amp;amp; "."
    End If
    If ContainsControlCharacter(ReadRequiredText) Then
        Err.Raise vbObjectError + 5013, , _
            fieldName &amp;amp; " contains a control character on row " &amp;amp; excelRow &amp;amp; "."
    End If
End Function

Private Sub ValidateStatus(ByVal statusText As String, _
                           ByVal excelRow As Long)
    If StrComp(statusText, READY_STATUS, vbBinaryCompare) &amp;lt;&amp;gt; 0 And _
       StrComp(statusText, HOLD_STATUS, vbBinaryCompare) &amp;lt;&amp;gt; 0 And _
       StrComp(statusText, DONE_STATUS, vbBinaryCompare) &amp;lt;&amp;gt; 0 Then
        Err.Raise vbObjectError + 5014, , _
            "QueueStatus must be exactly READY, HOLD, or DONE on row " &amp;amp; _
            excelRow &amp;amp; "."
    End If
End Sub

Private Sub ValidateStatusDisplay(ByVal outcomeText As String, _
                                   ByVal excelRow As Long)
    If Len(outcomeText) &amp;gt; 80 Then
        Err.Raise vbObjectError + 5054, , _
            "StatusDisplay exceeds 80 characters on row " &amp;amp; excelRow &amp;amp; "."
    End If
End Sub

Private Sub ValidateIdentifier(ByVal identifierText As String, _
                               ByVal fieldName As String, _
                               ByVal excelRow As Long)
    If Len(identifierText) &amp;gt; 80 Then
        Err.Raise vbObjectError + 5015, , _
            fieldName &amp;amp; " exceeds 80 characters on row " &amp;amp; excelRow &amp;amp; "."
    End If
End Sub

Private Sub AddUniqueValue(ByVal valuesSeen As Object, _
                           ByVal valueText As String, _
                           ByVal fieldName As String, _
                           ByVal excelRow As Long)
    If valuesSeen.Exists(valueText) Then
        Err.Raise vbObjectError + 5016, , _
            "Duplicate " &amp;amp; fieldName &amp;amp; " on rows " &amp;amp; _
            valuesSeen(valueText) &amp;amp; " and " &amp;amp; excelRow &amp;amp; ": " &amp;amp; valueText
    End If
    valuesSeen.Add valueText, excelRow
End Sub

Private Sub ValidateImageFileName(ByVal fileName As String, _
                                  ByVal fieldName As String, _
                                  ByVal excelRow As Long)
    Dim extensionPosition As Long
    Dim extensionText As String
    Dim baseName As String
    Dim forbidden As Variant
    Dim item As Variant

    forbidden = Array("&amp;lt;", "&amp;gt;", ":", Chr$(34), "/", "\", "|", "?", "*")
    For Each item In forbidden
        If InStr(1, fileName, CStr(item), vbBinaryCompare) &amp;gt; 0 Then
            Err.Raise vbObjectError + 5017, , _
                fieldName &amp;amp; " contains a forbidden path character on row " &amp;amp; _
                excelRow &amp;amp; "."
        End If
    Next item
    If Right$(fileName, 1) = "." Or Right$(fileName, 1) = " " Then
        Err.Raise vbObjectError + 5018, , _
            fieldName &amp;amp; " cannot end with a period or space on row " &amp;amp; _
            excelRow &amp;amp; "."
    End If
    extensionPosition = InStrRev(fileName, ".")
    If extensionPosition &amp;lt;= 1 Then
        Err.Raise vbObjectError + 5019, , _
            fieldName &amp;amp; " needs a PNG, JPG, or JPEG extension on row " &amp;amp; _
            excelRow &amp;amp; "."
    End If
    extensionText = UCase$(Mid$(fileName, extensionPosition + 1))
    If extensionText &amp;lt;&amp;gt; "PNG" And extensionText &amp;lt;&amp;gt; "JPG" And _
       extensionText &amp;lt;&amp;gt; "JPEG" Then
        Err.Raise vbObjectError + 5020, , _
            fieldName &amp;amp; " must use PNG, JPG, or JPEG on row " &amp;amp; excelRow &amp;amp; "."
    End If
    baseName = Left$(fileName, extensionPosition - 1)
    If IsReservedWindowsName(baseName) Then
        Err.Raise vbObjectError + 5053, , _
            fieldName &amp;amp; " uses a reserved Windows name on row " &amp;amp; excelRow &amp;amp; "."
    End If
End Sub

Private Sub ValidateFileStem(ByVal fileStem As String, _
                             ByVal excelRow As Long)
    Dim invalidCharacters As Variant
    Dim invalidCharacter As Variant
    Dim baseName As String
    Dim lowerName As String

    If Len(fileStem) &amp;gt; 120 Then
        Err.Raise vbObjectError + 5021, , _
            "OutputName exceeds 120 characters on row " &amp;amp; excelRow &amp;amp; "."
    End If
    lowerName = LCase$(fileStem)
    If Right$(lowerName, 5) = ".docx" Or _
       Right$(lowerName, 4) = ".pdf" Then
        Err.Raise vbObjectError + 5049, , _
            "OutputName must not include a .docx or .pdf extension on row " &amp;amp; _
            excelRow &amp;amp; "."
    End If
    invalidCharacters = Array("&amp;lt;", "&amp;gt;", ":", Chr$(34), "/", "\", _
        "|", "?", "*")
    For Each invalidCharacter In invalidCharacters
        If InStr(1, fileStem, CStr(invalidCharacter), vbBinaryCompare) &amp;gt; 0 Then
            Err.Raise vbObjectError + 5022, , _
                "OutputName contains a forbidden Windows character on row " &amp;amp; _
                excelRow &amp;amp; "."
        End If
    Next invalidCharacter
    If Right$(fileStem, 1) = "." Or Right$(fileStem, 1) = " " Then
        Err.Raise vbObjectError + 5023, , _
            "OutputName cannot end with a period or space on row " &amp;amp; _
            excelRow &amp;amp; "."
    End If
    baseName = fileStem
    If InStr(1, baseName, ".", vbBinaryCompare) &amp;gt; 0 Then
        baseName = Left$(baseName, InStr(1, baseName, ".", _
            vbBinaryCompare) - 1)
    End If
    If IsReservedWindowsName(baseName) Then
        Err.Raise vbObjectError + 5024, , _
            "OutputName uses a reserved Windows name on row " &amp;amp; excelRow &amp;amp; "."
    End If
End Sub

Private Sub ValidateImagePdfTemplate(ByVal doc As Object)
    RejectTrackedChanges doc, "image PDF template snapshot"
    If doc.Comments.Count &amp;gt; 0 Then
        Err.Raise vbObjectError + 5026, , _
            "Remove comments from ImagePdfTemplate.docx."
    End If
    RequireBookmark doc, "DocumentID"
    RequireBookmark doc, "RecordName"
    RequireBookmark doc, "Category"
    RequireBookmark doc, "DocumentDateDisplay"
    RequireBookmark doc, "PreparedBy"
    RequireBookmark doc, "StatusDisplay"
    RequireBookmark doc, "BodyText"
    RequireBookmark doc, "Image1"
    RequireBookmark doc, "Image1Caption"
    RequireBookmark doc, "Image2"
    RequireBookmark doc, "Image2Caption"
End Sub

Private Sub ValidateImagePdfResultBeforeSave(ByVal doc As Object)
    RejectTrackedChanges doc, "generated image PDF"
    If doc.Comments.Count &amp;gt; 0 Then
        Err.Raise vbObjectError + 5050, , _
            "The generated image PDF contains a comment before saving."
    End If
    RequireBookmark doc, "DocumentID"
    RequireBookmark doc, "RecordName"
    RequireBookmark doc, "Category"
    RequireBookmark doc, "DocumentDateDisplay"
    RequireBookmark doc, "PreparedBy"
    RequireBookmark doc, "StatusDisplay"
    RequireBookmark doc, "BodyText"
    RequireBookmark doc, "Image1"
    RequireBookmark doc, "Image1Caption"
    RequireBookmark doc, "Image2"
    RequireBookmark doc, "Image2Caption"
End Sub

Private Sub RejectTrackedChanges(ByVal doc As Object, _
                                 ByVal documentLabel As String)
    If doc.TrackRevisions Then
        Err.Raise vbObjectError + 5051, , _
            "Turn off Track Changes in the " &amp;amp; documentLabel &amp;amp; "."
    End If
    If CountRevisionsInAllStories(doc) &amp;gt; 0 Then
        Err.Raise vbObjectError + 5052, , _
            "Resolve tracked revisions in every story of the " &amp;amp; _
            documentLabel &amp;amp; "."
    End If
End Sub

Private Function CountRevisionsInAllStories(ByVal doc As Object) As Long
    Dim storyRoot As Object
    Dim currentStory As Object
    Dim revisionCount As Long

    For Each storyRoot In doc.StoryRanges
        Set currentStory = storyRoot
        Do While Not currentStory Is Nothing
            revisionCount = revisionCount + currentStory.Revisions.Count
            Set currentStory = currentStory.NextStoryRange
        Loop
    Next storyRoot
    CountRevisionsInAllStories = revisionCount
End Function

Private Sub RequireBookmark(ByVal doc As Object, _
                            ByVal bookmarkName As String)
    If Not doc.Bookmarks.Exists(bookmarkName) Then
        Err.Raise vbObjectError + 5027, , _
            "Missing required Word bookmark: " &amp;amp; bookmarkName
    End If
    If StrComp(doc.Bookmarks(bookmarkName).Name, bookmarkName, _
       vbBinaryCompare) &amp;lt;&amp;gt; 0 Then
        Err.Raise vbObjectError + 5056, , _
            "Word bookmark case mismatch: expected " &amp;amp; bookmarkName
    End If
End Sub

Private Sub WriteRequiredBookmark(ByVal doc As Object, _
                                  ByVal bookmarkName As String, _
                                  ByVal replacementText As String)
    Dim targetRange As Object
    Dim styleValue As Variant

    RequireBookmark doc, bookmarkName
    Set targetRange = doc.Bookmarks(bookmarkName).Range
    If targetRange.Fields.Count &amp;gt; 0 Or _
       targetRange.ContentControls.Count &amp;gt; 0 Or _
       targetRange.InlineShapes.Count &amp;gt; 0 Then
        Err.Raise vbObjectError + 5028, , _
            "Text bookmark contains a field, content control, or image: " &amp;amp; _
            bookmarkName
    End If
    If InStr(1, targetRange.Text, vbCr, vbBinaryCompare) &amp;gt; 0 Or _
       InStr(1, targetRange.Text, Chr$(7), vbBinaryCompare) &amp;gt; 0 Then
        Err.Raise vbObjectError + 5029, , _
            "Text bookmark includes a paragraph or cell marker: " &amp;amp; bookmarkName
    End If
    styleValue = targetRange.Style
    targetRange.Text = replacementText
    targetRange.Style = styleValue
    doc.Bookmarks.Add bookmarkName, targetRange
    If Not doc.Bookmarks.Exists(bookmarkName) Then
        Err.Raise vbObjectError + 5030, , _
            "Bookmark was not restored: " &amp;amp; bookmarkName
    End If
    If StrComp(CStr(doc.Bookmarks(bookmarkName).Range.Text), _
       replacementText, vbBinaryCompare) &amp;lt;&amp;gt; 0 Then
        Err.Raise vbObjectError + 5031, , _
            "Bookmark value differs after replacement: " &amp;amp; bookmarkName
    End If
End Sub

Private Sub InsertPhotoBookmark(ByVal doc As Object, _
                                    ByVal bookmarkName As String, _
                                    ByVal photoPath As String)
    Dim targetRange As Object
    Dim picture As Object
    Dim maximumWidth As Double
    Dim maximumHeight As Double

    RequireBookmark doc, bookmarkName
    Set targetRange = doc.Bookmarks(bookmarkName).Range
    If targetRange.Fields.Count &amp;gt; 0 Or _
       targetRange.ContentControls.Count &amp;gt; 0 Or _
       targetRange.InlineShapes.Count &amp;gt; 0 Then
        Err.Raise vbObjectError + 5032, , _
            "Photo bookmark contains a nested object."
    End If
    If InStr(1, targetRange.Text, vbCr, vbBinaryCompare) &amp;gt; 0 Or _
       InStr(1, targetRange.Text, Chr$(7), vbBinaryCompare) &amp;gt; 0 Then
        Err.Raise vbObjectError + 5033, , _
            "Photo bookmark includes a paragraph or cell marker."
    End If

    targetRange.Text = ""
    targetRange.Collapse WORD_COLLAPSE_START
    Set picture = doc.InlineShapes.AddPicture( _
        photoPath, False, True, targetRange)
    If picture.Width &amp;lt;= 0 Or picture.Height &amp;lt;= 0 Then
        Err.Raise vbObjectError + 5034, , _
            "Word inserted an invalid photo."
    End If
    picture.LockAspectRatio = OFFICE_TRUE
    maximumWidth = MAX_PHOTO_WIDTH_CM * POINTS_PER_CM
    maximumHeight = MAX_PHOTO_HEIGHT_CM * POINTS_PER_CM
    If picture.Width &amp;gt; maximumWidth Then picture.Width = maximumWidth
    If picture.Height &amp;gt; maximumHeight Then picture.Height = maximumHeight
    doc.Bookmarks.Add bookmarkName, picture.Range
    If Not doc.Bookmarks.Exists(bookmarkName) Then
        Err.Raise vbObjectError + 5035, , _
            "Photo bookmark was not restored."
    End If
    If doc.Bookmarks(bookmarkName).Range.InlineShapes.Count &amp;lt;&amp;gt; 1 Then
        Err.Raise vbObjectError + 5036, , _
            "Photo bookmark does not contain one embedded picture."
    End If
End Sub

Private Sub RequireRowUnchanged(ByVal ws As Worksheet, _
                                ByVal excelRow As Long, _
                                ByRef data As Variant, _
                                ByVal dataRow As Long)
    Dim columnIndex As Long
    Dim currentValue As Variant
    Dim originalValue As Variant

    For columnIndex = 1 To 13
        currentValue = ws.Cells(excelRow, columnIndex).Value2
        originalValue = data(dataRow, columnIndex)
        If Not VariantValuesExactlyEqual(originalValue, currentValue) Then
            Err.Raise vbObjectError + 5037, , _
                "Excel row " &amp;amp; excelRow &amp;amp; " changed after preflight. " &amp;amp; _
                "Run the batch again."
        End If
    Next columnIndex
End Sub

Private Function VariantValuesExactlyEqual(ByVal firstValue As Variant, _
                                            ByVal secondValue As Variant) As Boolean
    If IsError(firstValue) Or IsError(secondValue) Then
        Exit Function
    End If
    If VarType(firstValue) &amp;lt;&amp;gt; VarType(secondValue) Then Exit Function
    VariantValuesExactlyEqual = _
        (StrComp(CStr(firstValue), CStr(secondValue), vbBinaryCompare) = 0)
End Function

Private Function CreateRunFolder(ByVal fso As Object, _
                                 ByVal outputRoot As String) As String
    Dim baseFolder As String
    Dim candidate As String
    Dim suffix As Long

    baseFolder = "Run_" &amp;amp; Format$(Now, "yyyymmdd_hhnnss")
    candidate = JoinPath(outputRoot, baseFolder)
    Do While fso.FolderExists(candidate)
        suffix = suffix + 1
        candidate = JoinPath(outputRoot, baseFolder &amp;amp; "_" &amp;amp; _
            Format$(suffix, "000"))
    Loop
    fso.CreateFolder candidate
    CreateRunFolder = candidate
End Function

Private Sub EnsureFolder(ByVal folderPath As String)
    If FolderExistsStrict(folderPath) Then Exit Sub
    On Error GoTo CreateFailed
    MkDir folderPath
    Exit Sub
CreateFailed:
    Err.Raise vbObjectError + 5038, , _
        "Could not create folder: " &amp;amp; folderPath &amp;amp; ". " &amp;amp; Err.Description
End Sub

Private Sub RequireFolder(ByVal folderPath As String, _
                          ByVal folderLabel As String)
    If Not FolderExistsStrict(folderPath) Then
        Err.Raise vbObjectError + 5039, , _
            "Missing " &amp;amp; folderLabel &amp;amp; ": " &amp;amp; folderPath
    End If
End Sub

Private Sub RequireTargetAbsent(ByVal filePath As String)
    If FileExistsStrict(filePath) Then
        Err.Raise vbObjectError + 5040, , _
            "Refusing to overwrite existing file: " &amp;amp; filePath
    End If
End Sub

Private Sub RequireNonemptyFile(ByVal filePath As String, _
                                ByVal fileLabel As String)
    If Not FileExistsStrict(filePath) Then
        Err.Raise vbObjectError + 5041, , _
            "Missing " &amp;amp; fileLabel &amp;amp; ": " &amp;amp; filePath
    End If
    On Error GoTo SizeFailed
    If FileLen(filePath) &amp;lt;= 0 Then
        Err.Raise vbObjectError + 5042, , _
            "Empty " &amp;amp; fileLabel &amp;amp; ": " &amp;amp; filePath
    End If
    Exit Sub
SizeFailed:
    If Err.Number &amp;gt;= vbObjectError + 5041 And _
       Err.Number &amp;lt;= vbObjectError + 5042 Then
        Err.Raise Err.Number, , Err.Description
    End If
    Err.Raise vbObjectError + 5043, , _
        "Could not inspect " &amp;amp; fileLabel &amp;amp; ": " &amp;amp; filePath &amp;amp; _
        ". " &amp;amp; Err.Description
End Sub

Private Function FileExistsStrict(ByVal filePath As String) As Boolean
    Dim resultText As String

    On Error GoTo CheckFailed
    resultText = Dir$(filePath, vbNormal Or vbHidden Or vbSystem Or vbReadOnly)
    FileExistsStrict = (Len(resultText) &amp;gt; 0)
    Exit Function
CheckFailed:
    Err.Raise vbObjectError + 5044, , _
        "Could not check file path: " &amp;amp; filePath &amp;amp; ". " &amp;amp; Err.Description
End Function

Private Function FolderExistsStrict(ByVal folderPath As String) As Boolean
    Dim resultText As String

    On Error GoTo CheckFailed
    resultText = Dir$(folderPath, vbDirectory)
    If Len(resultText) = 0 Then
        FolderExistsStrict = False
    Else
        FolderExistsStrict = _
            ((GetAttr(folderPath) And vbDirectory) = vbDirectory)
    End If
    Exit Function
CheckFailed:
    Err.Raise vbObjectError + 5045, , _
        "Could not check folder path: " &amp;amp; folderPath &amp;amp; ". " &amp;amp; Err.Description
End Function

Private Function JoinPath(ByVal parentPath As String, _
                          ByVal childName As String) As String
    If Right$(parentPath, 1) = "\" Then
        JoinPath = parentPath &amp;amp; childName
    Else
        JoinPath = parentPath &amp;amp; "\" &amp;amp; childName
    End If
End Function

Private Function ContainsControlCharacter(ByVal valueText As String) As Boolean
    Dim characterIndex As Long
    Dim characterCode As Long

    For characterIndex = 1 To Len(valueText)
        characterCode = AscW(Mid$(valueText, characterIndex, 1))
        If characterCode &amp;gt;= 0 And characterCode &amp;lt;= 31 Then
            ContainsControlCharacter = True
            Exit Function
        End If
    Next characterIndex
End Function

Private Function IsReservedWindowsName(ByVal baseName As String) As Boolean
    Dim upperName As String
    Dim suffixText As String
    Dim suffixCode As Long

    upperName = UCase$(baseName)
    Select Case upperName
        Case "CON", "PRN", "AUX", "NUL", "CLOCK$"
            IsReservedWindowsName = True
            Exit Function
    End Select
    If Len(upperName) &amp;gt;= 4 Then
        If Left$(upperName, 3) = "COM" Or Left$(upperName, 3) = "LPT" Then
            suffixText = Mid$(upperName, 4)
            If Len(suffixText) = 1 Then
                suffixCode = AscW(suffixText)
                If (suffixCode &amp;gt;= AscW("1") And suffixCode &amp;lt;= AscW("9")) Or _
                   suffixText = ChrW$(&amp;amp;HB9) Or _
                   suffixText = ChrW$(&amp;amp;HB2) Or _
                   suffixText = ChrW$(&amp;amp;HB3) Then
                    IsReservedWindowsName = True
                End If
            End If
        End If
    End If
End Function
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The example uses Word’s documented &lt;a href="https://learn.microsoft.com/en-us/office/vba/api/word.bookmarks.exists" rel="noopener noreferrer"&gt;bookmark checks&lt;/a&gt;, &lt;a href="https://learn.microsoft.com/en-us/office/vba/api/word.inlineshapes.addpicture" rel="noopener noreferrer"&gt;embedded image insertion&lt;/a&gt;, &lt;a href="https://learn.microsoft.com/en-us/office/vba/api/word.saveas2" rel="noopener noreferrer"&gt;temporary DOCX saving&lt;/a&gt;, and &lt;a href="https://learn.microsoft.com/en-us/office/vba/api/word.document.exportasfixedformat" rel="noopener noreferrer"&gt;PDF export&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reconcile the run before releasing PDFs
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Queue reconciliation
&lt;/h3&gt;

&lt;p&gt;Match every DONE row with one nonempty PDF in Completed and investigate any retained Staging files.&lt;/p&gt;

&lt;h3&gt;
  
  
  Data accuracy
&lt;/h3&gt;

&lt;p&gt;Confirm ID, record name, category, date, preparer, display status, and body against the approved source.&lt;/p&gt;

&lt;h3&gt;
  
  
  Image identity
&lt;/h3&gt;

&lt;p&gt;Verify both embedded images belong to the correct row and were not transposed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Visual output
&lt;/h3&gt;

&lt;p&gt;Inspect image fit, captions, tables, page breaks, headers, footers, and every PDF page.&lt;/p&gt;

&lt;h3&gt;
  
  
  Metadata policy
&lt;/h3&gt;

&lt;p&gt;Decide whether Word document properties may be included in PDF and inspect sensitive outputs before delivery.&lt;/p&gt;

&lt;h3&gt;
  
  
  Release record
&lt;/h3&gt;

&lt;p&gt;Record approval, recipient, channel, correction history, retention, and deletion separately from QueueStatus.&lt;/p&gt;

&lt;h2&gt;
  
  
  Know what the offline example does not guarantee
&lt;/h2&gt;

&lt;h3&gt;
  
  
  No image compression
&lt;/h3&gt;

&lt;p&gt;Displayed dimensions change, but embedded source bytes may still make PDFs large.&lt;/p&gt;

&lt;h3&gt;
  
  
  No image authentication
&lt;/h3&gt;

&lt;p&gt;The macro does not prove provenance, capture time, identity, or authorization.&lt;/p&gt;

&lt;h3&gt;
  
  
  No fully atomic commit
&lt;/h3&gt;

&lt;p&gt;Deleting the temporary DOCX, moving the PDF, and saving DONE are separate operations.&lt;/p&gt;

&lt;h3&gt;
  
  
  No cloud detection
&lt;/h3&gt;

&lt;p&gt;The code does not detect synchronized folders, backup tools, or later uploads.&lt;/p&gt;

&lt;h3&gt;
  
  
  No concurrent writer protection
&lt;/h3&gt;

&lt;p&gt;Multiple processes and shared output roots need separate coordination.&lt;/p&gt;

&lt;h3&gt;
  
  
  No release decision
&lt;/h3&gt;

&lt;p&gt;DONE proves generation status, not legal, HR, compliance, or business approval.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use Factory for repeated offline PDF output
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Where DocxForge Pro fits&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docxforgepro.com/" rel="noopener noreferrer"&gt;DocxForge Pro&lt;/a&gt; Factory applies one Word template to many independent Excel rows and creates a separate output for each row. Contractor is reserved for one case that needs several different templates.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgumwo4k4k51fnjggobna.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgumwo4k4k51fnjggobna.png" alt="DocxForge Pro Factory Excel queue for offline PDF generation" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Review independent queue rows and document-ready values.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7y2h2aor2sadpxsktj5d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7y2h2aor2sadpxsktj5d.png" alt="DocxForge Pro Factory documents for offline image PDF output" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Generate separate PDFs from one approved Word template.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Generate image-based PDFs locally with Factory&lt;/strong&gt;7 days free, then $38 every 3 months • 14-day refund after purchase.&lt;/p&gt;

&lt;p&gt;Bounded batchesOne Word templateLocal imagesPDF output&lt;/p&gt;

&lt;p&gt;Start Free 7-Day Trial&lt;/p&gt;

&lt;h2&gt;
  
  
  Continue with the matching PDF and image controls
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://docxforgepro.com/blog/how-to-create-pdf-reports-from-excel-with-photos" rel="noopener noreferrer"&gt;Design a fixed photo-report contract&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Focus on the report fields, photo captions, Word layout, and final release review.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://docxforgepro.com/blog/fix-pdf-output-is-too-large-after-adding-photos" rel="noopener noreferrer"&gt;Control oversized image PDFs&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Prepare appropriately sized image copies and set a byte budget before generation.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://docxforgepro.com/blog/local-folder-photos-vs-embedded-spreadsheet-images-for-document-workflows" rel="noopener noreferrer"&gt;Choose an image-storage model&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Compare controlled folder assets with images stored inside Excel.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://docxforgepro.com/blog/how-to-measure-throughput-gains-in-document-generation-projects" rel="noopener noreferrer"&gt;Measure throughput gains&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Compare manual and automated cycle time without double-counting the same saved work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frequently asked questions
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Does this workflow upload Excel files or images to a cloud service?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No upload is performed by the example VBA. Excel, Word, the template, images, temporary DOCX files, and final PDFs are handled through local paths. Avoid cloud-synchronized folders if the requirement is strictly local storage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why does a PDF-only workflow create a temporary DOCX?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Word template must first be filled and saved as a temporary DOCX before Word exports the PDF. After both files are confirmed nonempty, the temporary DOCX is deleted and only the PDF moves into &lt;code&gt;Completed&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why is each run limited to 100 PDFs?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The limit keeps each Word session and recovery review manageable. Additional validated rows remain &lt;code&gt;READY&lt;/code&gt; and can be processed in the next run.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can the two image slots contain a logo or signature?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;They can contain approved PNG, JPG, or JPEG assets, but the template contract is fixed. A signature image is not a digital signature and does not prove authorization, identity, or consent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does DONE mean the PDF is approved for release?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No. &lt;code&gt;DONE&lt;/code&gt; records successful PDF creation and workbook saving. A reviewer must still confirm the data, image identity, layout, metadata policy, recipient, and release authorization.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does the macro reduce the byte size of large images?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No. It reduces displayed dimensions while preserving aspect ratio, but it does not recompress the source bytes. Prepare separate report-sized image copies when PDF size matters.&lt;/p&gt;




&lt;p&gt;This article was prepared with AI assistance.&lt;/p&gt;

</description>
      <category>automation</category>
      <category>vba</category>
      <category>excel</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
