Document Types & Use Cases

How to Generate Offer Letters from Excel and Word Templates

HR teams often spend hours customizing each offer letter, juggling Excel data, Word templates, and image assets. By linking a structured spreadsheet to a standard Word template, you can automatically populate candidate details, insert logos or signatures, and output both DOCX and PDF files without manual copy‑pasting. The result is a repeatable, offline‑first workflow that keeps sensitive data on the local PC.

Offer letters
Word + optional PDF
Formatting-safe values
Local Windows workflow
7-day free trial on the 3-month plan • 14-day refund policy • Microsoft Word Desktop required • Local processing

Batch‑ready

One Excel row → one personalized letter

No cloud, fully local See pricing

Quick answer

Link a clean Excel sheet to a Word offer‑letter template, let VBA read each row, replace placeholders, insert any required images, and save the result as both DOCX and PDF. The macro also creates the necessary output folders, so every candidate gets a ready‑to‑send package without manual file handling.

In plain English

The macro loops through every record, fills fields like {{CandidateName}} or {{StartDate}}, swaps in logo and signature images using tags such as {{photo_logo}}, then writes the finished document to a WORD folder and a matching PDF to a PDF folder. All processing stays on the user’s computer and it logs any missing images so you can address gaps before sending the letters.

Why this matters

HR departments need a reliable way to turn structured data into formal, brand‑consistent offer letters. Manual copying introduces errors, slows onboarding, and makes it hard to keep templates up to date across dozens of hires.

Accuracy and consistency

When every field is driven from a single source of truth—your Excel sheet—typos and mismatched figures disappear. The same template is used for every candidate, ensuring the company’s branding, legal language, and layout stay uniform.

Scalability

A spreadsheet can hold hundreds of rows. The VBA loop treats each row as a separate document, letting you generate a whole hiring batch in minutes rather than hours. This scales without adding extra software or cloud services.

Compliance and auditability

Because the data originates from a controlled workbook, you can retain the source file for audit purposes, proving that each offer letter was generated from approved values. This supports internal compliance checks and reduces the risk of undocumented manual edits.

What goes wrong

Many teams start with a manual copy‑paste approach or a half‑built macro that only handles text. The result is a fragile process that breaks when a new column is added, an image is missing, or the template changes.

Typical manual workflow

Open the template, copy‑paste candidate data, manually insert the logo, save the file, repeat for every row. Small mistakes creep in, file names become inconsistent, and PDFs must be exported one by one.

Automated Excel‑to‑Word workflow

A single VBA macro reads each spreadsheet row, replaces all placeholders, inserts images automatically, saves DOCX and PDF in predefined folders, and reports success at the end. No manual renaming or individual PDF export steps.

Without automation you risk data errors, wasted time, and a non‑repeatable process that can’t keep up with hiring spikes. Even a small typo can delay contracts and affect candidate experience.

What the workflow looks like

The end‑to‑end workflow consists of three well‑defined stages: prepare data, run the macro, and collect the generated files. Each stage can be audited and repeated without re‑creating the underlying files.

Step 1

Prepare the source workbook

Create a sheet called “Data” with a header row. Required columns typically include CandidateName, Position, Salary, StartDate, LogoFileName, and SignatureFileName. Keep image files (PNG or JPG) in a folder next to the workbook; the filename column should match the actual file name.

Step 2

Set up the Word template

Insert clearly delimited placeholders such as {{CandidateName}}, {{Position}}, {{Salary}}, {{StartDate}}. For images use tags like {{photo_logo}} and {{photo_signature}} where the VBA will replace the tag with the appropriate picture. Save the template as OfferTemplate.docx in the same folder as the workbook.

Step 3

Run the VBA macro

Open the VBA editor (Alt + F11) in Excel, paste the provided code into a standard module, and adjust the templatePath or imgFolder variables if needed. Execute GenerateOfferLetters. The macro creates OUTPUT\WORD and OUTPUT\PDF subfolders, writes each personalized document, and shows a completion message.

Step 4

Verify output

Open a few DOCX files to confirm placeholders were replaced and images appear correctly. Open the matching PDFs to ensure the ExportAsFixedFormat step succeeded. Any missing image will be skipped with a silent fallback, leaving the placeholder removed.

A visual example

Simple visual illustration.

How to Generate Offer Letters from Excel and Word Templates

AI-generated illustration for article.

A grounded VBA example

Below is a ready‑to‑use VBA macro that wires the Excel sheet to a Word template, handles image tags, and exports both DOCX and PDF files. It follows best‑practice steps such as folder validation and error‑aware Find / Replace.

Key actions performed

• Loop through each data row • Replace text placeholders • Insert images for tags like photo_logo and photo_signature • Save the completed document as DOCX • Export the same document as PDF using ExportAsFixedFormat • Ensure output folders exist before writing files

Sub GenerateOfferLetters()
    Dim xlApp As Excel.Application
    Dim xlWB As Excel.Workbook
    Dim xlWS As Excel.Worksheet
    Dim lastRow As Long, i As Long
    
    Dim wdApp As Word.Application
    Dim wdDoc As Word.Document
    Dim templatePath As String
    Dim outputDocPath As String
    Dim outputPdfPath As String
    Dim imgFolder As String
    
    '--- Configuration ---
    templatePath = ThisWorkbook.Path & "\OfferTemplate.docx"
    imgFolder = ThisWorkbook.Path & "\Photos"
    
    Set xlApp = Application
    Set xlWB = xlApp.ActiveWorkbook
    Set xlWS = xlWB.Sheets("Data")
    
    Set wdApp = New Word.Application
    wdApp.Visible = False
    
    lastRow = xlWS.Cells(xlWS.Rows.Count, "A").End(xlUp).Row
    
    For i = 2 To lastRow 'Assume header in row 1
        Dim candidateName As String, position As String, salary As String, startDate As String
        Dim logoFile As String, signatureFile As String
        
        candidateName = xlWS.Cells(i, "A").Value
        position = xlWS.Cells(i, "B").Value
        salary = xlWS.Cells(i, "C").Value
        startDate = xlWS.Cells(i, "D").Text
        logoFile = xlWS.Cells(i, "E").Value
        signatureFile = xlWS.Cells(i, "F").Value
        
        Set wdDoc = wdApp.Documents.Open(templatePath, ReadOnly:=True)
        
        Call ReplacePlaceholder(wdDoc, "{{CandidateName}}", candidateName)
        Call ReplacePlaceholder(wdDoc, "{{Position}}", position)
        Call ReplacePlaceholder(wdDoc, "{{Salary}}", salary)
        Call ReplacePlaceholder(wdDoc, "{{StartDate}}", startDate)
        
        If Len(logoFile) > 0 Then Call InsertImage(wdDoc, "photo_logo", imgFolder & "\" & logoFile)
        If Len(signatureFile) > 0 Then Call InsertImage(wdDoc, "photo_signature", imgFolder & "\" & signatureFile)
        
        outputDocPath = ThisWorkbook.Path & "\OUTPUT\WORD\" & candidateName & " - Offer.docx"
        EnsureFolder ThisWorkbook.Path & "\OUTPUT\WORD\"
        wdDoc.SaveAs2 FileName:=outputDocPath, FileFormat:=wdFormatXMLDocument
        
        outputPdfPath = ThisWorkbook.Path & "\OUTPUT\PDF\" & candidateName & " - Offer.pdf"
        EnsureFolder ThisWorkbook.Path & "\OUTPUT\PDF\"
        wdDoc.ExportAsFixedFormat OutputFileName:=outputPdfPath, ExportFormat:=wdExportFormatPDF
        
        wdDoc.Close SaveChanges:=False
    Next i
    
    wdApp.Quit
    MsgBox "Offer letters generated: " & (lastRow - 1) & " documents.", vbInformation
End Sub

Private Sub ReplacePlaceholder(ByVal doc As Word.Document, ByVal placeholder As String, ByVal newText As String)
    With doc.Content.Find
        .Text = placeholder
        .Replacement.Text = newText
        .Wrap = wdFindContinue
        .Execute Replace:=wdReplaceAll
    End With
End Sub

Private Sub InsertImage(ByVal doc As Word.Document, ByVal tag As String, ByVal imgPath As String)
    If Dir(imgPath) <> "" Then
        Dim rng As Word.Range
        Set rng = doc.Content
        With rng.Find
            .Text = "{{" & tag & "}}"
            .Replacement.Text = ""
            .Wrap = wdFindContinue
            .Execute
            If .Found Then
                rng.InlineShapes.AddPicture FileName:=imgPath, LinkToFile:=False, SaveWithDocument:=True
            End If
        End With
    End If
End Sub

Private Sub EnsureFolder(ByVal folderPath As String)
    If Dir(folderPath, vbDirectory) = "" Then MkDir folderPath
End Sub

Adjust the column letters or tag names in the code to match your exact spreadsheet layout. The macro runs without requiring any third‑party add‑ins.

Where VBA starts to strain

While VBA handles most typical offer‑letter scenarios, it has practical limits you should be aware of before scaling to very large batches or complex layouts.

Performance on very large sheets

Processing thousands of rows can become slow because each iteration opens and closes Word. For extremely large hires you may want to split the spreadsheet into smaller batches or consider a dedicated document‑generation tool.

Complex layout features

VBA’s Find / Replace works well for simple text and inline images. Advanced features such as content controls, conditional sections, or dynamic tables may require more sophisticated code or a template engine beyond basic VBA.

Maintenance overhead

Every time the template changes or a new field is added, the VBA code must be updated to map the new placeholder. Over time, this adds a maintenance burden that can be avoided with a purpose‑built document‑generation platform.

A calmer way to standardize the workflow

DocxForge Pro builds on this manual VBA pattern and removes the need to write and maintain code. It provides a graphical batch wizard, automatic folder handling, and built‑in support for logo, signature, and stamp tags.

DocxForge Pro 7 days free, then $38 every 3 months • 14-day refund after purchase

For repeatable business documents such as reports contracts certificates letters and packs DocxForge Pro can act as the local layer between spreadsheet data Word templates and final output. The layout stays in the Word template while the data comes from the spreadsheet workflow.

This fits teams that produce repeatable reports contracts certificates forms letters or document packs from structured data. This is useful when teams already rely on Word templates and do not want to redesign the output format from scratch. The article’s VBA example shows the spreadsheet-side automation while DocxForge Pro fits as the document-generation layer outside the code example itself.

Start Free 7-Day Trial

Zero‑code batch wizard

Load your Excel file, map columns to placeholders, and let the tool generate DOCX and PDF in one click—no macro editing required.

Robust image handling

Special tags like photo_logo, photo_signature, and photo_stamp are optimized automatically, with correct DPI and transparency support.

Frequently asked questions

Common questions about this workflow

Is this workflow suitable for generating offer letters from Excel and Word templates?

Yes. The macro is designed specifically for HR use‑cases where each spreadsheet row represents one candidate. It fills text fields, inserts branding images, and outputs both editable Word files and ready‑to‑send PDFs.

What source data has to stay consistent before generation starts?

Your Excel sheet must keep column names stable (e.g., CandidateName, Position, Salary, StartDate, LogoFileName, SignatureFileName) and the image files must be placed in the referenced folder. Any change to column order requires a matching update in the VBA code.

How do I adapt the template without breaking the workflow?

Add or remove placeholders only inside double braces (e.g., {{NewField}}). After editing the Word template, update the VBA ReplacePlaceholder calls to include the new tag. As long as the tag syntax stays consistent, the macro will continue to work.

A more repeatable way to handle this workflow eliminates manual macro maintenance and gives you built‑in safety nets. 7 days free, then $38 every 3 months • 14-day refund after purchase
No custom VBA to maintainAutomatic folder creation and cleanupBuilt‑in support for logo, signature, and stamp images
Start Free 7-Day Trial

Topics and Tags

Browse related topic clusters and workflow tags connected to this article.

Document Types & Use Cases Templates Excel to Word Letters HR

Continue Reading

Explore more articles related to this workflow, problem, or document automation topic.