How to Fix VBA Error 438 When Copying Embedded Word Documents in Excel
Question details
The user encounters run-time error 438 when attempting to copy an embedded Word document into an email using an Excel VBA macro.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Automating the extraction or opening of an embedded Word document into an email via Excel VBA.
- Observed behavior
- Excel VBA throws run-time error 438 (Object doesn't support this property or method) due to an ambiguous OLE object reference.
Ensure you have saved a backup of your Excel workbook before modifying the VBA code, and verify the exact name of your embedded OLE object (e.g., 'Object1') in the worksheet.
Explicitly Reference the Word Application's Documents Collection
Update the VBA script to explicitly use the Word application object when opening the OLE object to prevent ambiguous reference errors.
Run-time error 438 usually occurs when VBA tries to access a property or method that the referenced object does not support. Directly manipulating an OLE object without specifying the correct application context (such as Word) will trigger this failure.
Press Alt + F11 on your keyboard while in Excel to open the Microsoft Visual Basic for Applications window.
In the Project Explorer pane on the left, double-click the module or worksheet containing your email automation script.
Locate the specific line of code where the macro attempts to open the embedded Word document OLE object.
Replace the problematic line with an explicit reference: Set doc = wd.Application.Documents.Open(Worksheets("Email").OLEObjects("Object1")).
Ensure that 'wd' is properly declared and set as a valid Word application object earlier in your code, and that 'Object1' matches the exact name of the embedded object.

Try WPS Office for High VBA Compatibility and Seamless Spreadsheet Editing
If you frequently encounter macro syntax errors or compatibility bottlenecks in Microsoft Office, consider switching to WPS Office. It provides an excellent, lightweight alternative with robust support for Excel files and VBA macros.
- 1. Download and Install: Visit the official WPS website to download and install the free WPS Office suite.
- 2. Open Your Macro-Enabled File: Launch WPS Spreadsheet and open your .xlsm workbook directly without converting the format.
- 3. Run Macros Seamlessly: Access the Developer tab to view, edit, and run your VBA code with exceptional compatibility.

Frequently Asked Questions
What causes run-time error 438 in Excel VBA?
Run-time error 438 occurs when a referenced object does not support the property or method you are attempting to execute. In this context, calling an action on an OLE object directly without specifying the parent application (like Word) causes the error.
How do I find the exact name of my embedded OLE object in Excel?
Click once on the embedded Word document icon in your worksheet to select it. Then, look at the Name Box (the text box located immediately to the left of the formula bar) to see its exact name, which is often a default like 'Object1'.
Does WPS Office support Excel VBA macros?
Yes, WPS Office offers excellent compatibility with Microsoft Office formats, including the ability to run, edit, and debug VBA macros in .xlsm files. Depending on your version and region, VBA support is seamlessly integrated.
What does 'early binding' mean in VBA?
Early binding refers to setting a specific reference to an external object library (such as the Microsoft Word Object Library) via Tools > References in the VBA editor. This provides autocomplete features and better error checking during coding.




