VBA & Macro Problems

Make Excel VBA References Compatible with Multiple Office Versions

Algirdas JasaitisAlgirdas Jasaitis Nov 18, 2026 869 views

Question details

Make an Excel VBA project work across Office versions without depending on version-specific object library references.

Make Excel VBA References Compatible with Multiple Office Versions
Product
Microsoft Excel VBA in Microsoft 365 and Office 2010
Device & OS
not provided
Scenario
A workbook developed with Office 16.0 references needs to run on a computer with Office 2010.
Observed behavior
The VBA project works in Microsoft 365 but fails on the Office 2010 computer.
Before you start

Open the workbook in Excel, press Alt+F11, and check Tools > References for libraries marked MISSING. Identify any Word or Office objects and constants used by the project before changing references.

Solution 1Recommended

Use Late Binding for Version-Specific Office Objects

Reduce dependencies on specific Office library versions when distributing the workbook to computers with different Office installations.

Late binding creates and accesses external application objects at runtime instead of requiring a specific library reference at compile time. It does not make features introduced in newer Office versions available in Office 2010.

1
Review the project references

In the VBA editor, select Tools > References. Clear unnecessary or MISSING version-specific references, including the Microsoft Office 16.0 Object Library if the project no longer requires it. Keep required host and VBA references.

2
Change external object declarations

In the affected VBA modules, replace declarations such as Dim wordApp As Word.Application with Dim wordApp As Object. Create the application with Set wordApp = CreateObject("Word.Application") when automating Word.

3
Replace library constants

In the VBA editor, replace constants supplied by removed libraries with their documented numeric values or locally defined constants. For example, use Const wdDoNotSaveChanges As Long = 0 before passing that value to a Word method.

4
Compile and test the project

Select Debug > Compile VBAProject and fix each reported reference-specific declaration or constant. Then run the relevant macros on both Office 2010 and Microsoft 365, checking that every method and feature is supported.

Use Late Binding for Version-Specific Office Objects
Automatic reference changes: Changing references programmatically is possible but fragile. Late binding is generally more reliable, although the target application, such as Word, must still be installed for CreateObject to work.
Free Microsoft Office alternative

Work with Excel Files in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for working with Microsoft Office files. Open existing spreadsheets and migrate everyday document work easily; it does not repair Microsoft Excel VBA references, and macro support may vary by edition.

Open and edit Excel spreadsheet files in a familiar interfaceCompatible with common Microsoft Office formats, including XLSX, DOCX, and PPTXUse a free, lightweight suite for everyday office tasks
microsoft office alternative - wps office

Frequently Asked Questions

Can Excel automatically select the correct Office library version for my VBA project?

Reference resolution can vary between installations, so it is not a dependable way to handle every version difference. Use Tools > References to remove unnecessary dependencies and use late binding for external objects where practical.

How do I find a missing VBA reference?

Press Alt+F11 in Excel, then select Tools > References. Look for entries marked MISSING and review whether the project still needs them before clearing their checkboxes.

Why does a constant stop working after I remove a reference?

The constant may be defined in the removed library. Replace it with its documented numeric value or declare a local constant, then select Debug > Compile VBAProject to check for other unresolved names.

Does late binding guarantee that a macro will work in Office 2010?

No. Late binding reduces library reference dependencies, but Office 2010 must still support the methods and features the macro calls. Test the macro on the target version.

Do I need Word installed to automate it from Excel?

Yes. A call such as CreateObject("Word.Application") requires Word to be installed and available on the computer running the macro.