VBA & Macro Problems

How to Transfer Word Survey Results to Specific Excel Cells using VBA

Rana GarciaRana Garcia Nov 3, 2026 869 views

Question details

The user wants to programmatically extract data from protected Word drop-down form responses and populate specific cells in an Excel workbook.

Transfer Word Survey Results to Specific Excel Cells using VBA
Product
Microsoft Excel, Microsoft Word
Device & OS
not provided
Scenario
Automating the consolidation of survey results by extracting responses collected in Word form fields and mapping them to predefined cells in an Excel tracker.
Observed behavior
The goal is to use a VBA script to open the Word document, identify specific form fields or inline controls, read their selected values, and write those values accurately into designated Excel cells.
Before you start

Ensure that your Word document contains consistently named form fields (bookmarks) and that you have enabled the 'Microsoft Word Object Library' reference in the Excel VBA Editor.

Solution 1Recommended

Use an Excel VBA Macro to Extract Word Form Fields

Write a VBA script in Excel that opens the target Word document, loops through its form fields, and maps the extracted results to your chosen Excel cells.

By utilizing the Microsoft Word Object Library in Excel VBA, you can control the Word application in the background. This allows your script to locate specific form fields, read their current values (even if the document is protected for form filling), and insert them directly into designated spreadsheet cells.

1
Enable the Word Object Library Reference

Open your Excel workbook and press ALT + F11 to launch the VBA Editor. Navigate to the top menu, click 'Tools' > 'References', scroll down to find 'Microsoft Word XX.X Object Library', check the box next to it, and click 'OK'.

2
Insert a New Module

In the VBA Editor, right-click on your workbook name in the Project Explorer pane on the left, select 'Insert', and then click 'Module'. This will create a blank space for your macro code.

3
Write the Data Extraction Script

Create a sub-routine that defines a Word Application object. Use `Documents.Open` with the file path of your survey to open the Word file. Then, access the form fields by their bookmark names. For example, use `ActiveSheet.Range("B2").Value = wordDoc.FormFields("Dropdown1").Result` to pull the data.

4
Close the Document and Release Objects

At the end of your script, ensure you include code to close the Word document without saving changes (e.g., `wordDoc.Close False`) and quit the Word application instance to prevent memory leaks.

5
Run the Macro

Save your Excel file as a Macro-Enabled Workbook (.xlsm). Press ALT + F8 to open the Macro dialog box, select your newly created script, and click 'Run' to transfer the survey data.

Use an Excel VBA Macro to Extract Word Form Fields
Consistent Field Naming: For the VBA code to work seamlessly, ensure you assign identifiable and consistent bookmark names to your drop-down form fields in Word via the field's Properties menu.
Automate Data with WPS Office

Easily Transfer Word Form Data to WPS Spreadsheet using Macros

WPS Office offers robust VBA and macro support, allowing you to effortlessly automate the extraction of survey responses from WPS Writer documents directly into WPS Spreadsheet cells without complex configurations.

  1. 1. Open WPS Spreadsheet: Launch WPS Spreadsheet and open the macro-enabled workbook where you want to collect the survey data.
  2. 2. Access the Developer Tools: Navigate to the 'Developer' tab on the top ribbon and click on 'Visual Basic' to open the VBA Editor.
  3. 3. Input Your Macro Code: Insert a module and write your VBA script to reference WPS Writer and map the document's form fields to specific cells.
  4. 4. Execute the Data Transfer: Run the macro from the Developer tab to instantly extract and populate your survey results into the spreadsheet.
Seamless execution of VBA macros to automate repetitive data entryFull compatibility with Microsoft Excel (.xlsm) and Word (.docm) macro formatsLightweight suite that natively integrates Writer, Spreadsheet, and PresentationFree and intuitive interface for creating forms and consolidating data
microsoft office alternative - wps office

Frequently Asked Questions

Why is my Excel VBA script unable to open the Word document?

This error typically occurs if the file path specified in your code is incorrect, or if the 'Microsoft Word Object Library' reference has not been enabled in the VBA Editor under Tools > References.

Can I extract data from multiple Word survey documents at once?

Yes. You can enhance your VBA script by incorporating a loop using the `Dir` function or `FileDialog` object. This allows the macro to iterate through an entire folder of Word documents, extracting the data from each and writing it into consecutive rows in your Excel sheet.

How do I find the bookmark names of the drop-down fields in my Word document?

In Microsoft Word, ensure the Developer tab is active. Double-click the drop-down form field to open its 'Drop-Down Form Field Options' dialog box. Look for the 'Bookmark' field under the 'Field settings' section—this is the exact name you must use in your VBA script.

Does this VBA extraction method work if the Word document is password protected for filling in forms?

Yes. VBA can read the `.Result` property of a form field even when the document is restricted to filling in forms. You only need to supply the password in your code if you intend to unprotect the document to modify its core structure or add new fields.