Forum Discussion

RICARDO JULIO RODRIGUEZ FERNANDEZ's avatar
Oct 05, 2025

Drop down menu linked to an Excel file

Hi! I would like to populate Word drop down menu to data stored in Excel spreadsheets. I found a post (https://learn.microsoft.com/en-us/answers/questions/5448059/drop-down-menu-linked-to-a-file) in https://learn.microsoft.com showing how to get it done, but I'm new to VBA and need a more detailed explanation. The last line in that post reads, "For a step-by-step guide, you can check out this tutorial on linking Excel drop-down lists to Word.", but no link to that step-by-step guide is provided.

Please, do you know where that guide, or any other helpful manual, is available?

Thanks!

3 Replies

  • Thanks! Both answers open a new universe to me! I started trying the proposal of Kidd_Ip​  reply that seems to me more straightforward, but I'm stuck with an error. Please see below for my elementary data source, the error message, and the debug highlight of the code.

    Could you help me understand and work out this issue? Thanks!

  • Below may be worth trying:

     

    • A Word document with a Combo Box Content Control
    • An Excel file with your list of options (e.g., in Column A)
    • Access to the VBA Editor in Word (press Alt + F11)

     

    Sub PopulateDropdownFromExcel()
        Dim exlApp As Object
        Dim xlWrkBok As Object
        Dim sheetName As String
        Dim wkbkName As String
        Dim LRow As Long
        Dim i As Long
    
        ' Excel file path and sheet name
        wkbkName = "C:\Path\To\Your\File.xlsx"
        sheetName = "Sheet1"
    
        ' Start Excel
        Set exlApp = CreateObject("Excel.Application")
        Set xlWrkBok = exlApp.Workbooks.Open(wkbkName, ReadOnly:=True)
    
        With xlWrkBok.Worksheets(sheetName)
            LRow = .Cells(.Rows.Count, 1).End(-4162).Row ' -4162 = xlUp
            Selection.Range.ContentControls(1).DropdownListEntries.Clear
            For i = 1 To LRow
                Selection.Range.ContentControls(1).DropdownListEntries.Add Text:=Trim(.Cells(i, 1).Value)
            Next i
        End With
    
        xlWrkBok.Close SaveChanges:=False
        exlApp.Quit
    End Sub

     

    1. Open your Word document.
    2. Insert a Combo Box Content Control from the Developer tab.
    3. Press Alt + F11 to open the VBA editor.
    4. Paste the code into a new module.
    5. Run the macro (F5) while your cursor is inside the Combo Box.

Resources