Office Compatibility Issues

Fix the Hidden Module Utility Compile Error After Changing Office Versions

Chanuka GeekiyanageChanuka Geekiyanage Nov 25, 2026 868 views

Question details

Resolve a VBA compile error in the hidden Utility module after changing Microsoft Office versions and architectures.

Fix the Hidden Module Utility Compile Error After Changing Office Versions
Product
Microsoft Office 2010 and Office 2016
Device & OS
not provided
Scenario
The user switched from Office 2016 32-bit to Office 2010 64-bit, then installed Office 2010 32-bit after the error appeared.
Observed behavior
The message “Compile error in hidden module: Utility” appeared in Office 2010 64-bit and continued after switching to Office 2010 32-bit.
Before you start

Note which Office application and document or add-in trigger the error. In an Office app, check File > Account > About to confirm the installed version and whether it is 32-bit or 64-bit.

Solution 1Recommended

Remove Remaining Office Installations and Reinstall One Version

Use a clean single-version installation to rule out leftover or conflicting Office components.

1
Check installed Office versions

Open Windows Settings > Apps > Installed apps, or Control Panel > Programs and Features, and look for Microsoft Office installations.

2
Uninstall Office

Select each Office installation and choose Uninstall. If removal fails or components remain, use Microsoft's Office uninstall tool if it supports the installed version, following its instructions.

3
Restart and reinstall

Restart Windows, then use your Office installation media or Microsoft account to install and activate the one Office version and architecture you need.

4
Test the affected file

Open the Office application and the document or add-in that produced the Utility error. If the error remains, inspect its VBA project and references.

Remove Remaining Office Installations and Reinstall One Version
If you install another Office version later: Check Microsoft's coexistence requirements for the specific Office versions and installers before installing them side by side; matching architectures alone may not be sufficient.
Free Microsoft Office alternative

Work with Office Documents in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for opening and editing Office documents. Its format support makes it easier to move everyday files, although it does not repair Microsoft Office or guarantee compatibility with VBA macros and add-ins.

Open and edit Microsoft Word, Excel, and PowerPoint formats, including DOCX, XLSX, and PPTXUse a familiar interface for everyday document, spreadsheet, and presentation workMove compatible Office files without reinstalling Microsoft OfficeUse a free, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Why does the Utility compile error remain after switching back to 32-bit Office?

A missing VBA reference, incompatible code, an add-in, or remaining Office components may still cause it. Check Tools > References in the VBA editor and test the affected add-ins.

How do I check whether Office is 32-bit or 64-bit?

In an Office application, open File > Account > About and look for the architecture beside the version information. The exact menu wording can vary by Office version.

What if the Utility module is hidden or password-protected?

Contact the document or add-in developer for debugging access or a compatible update. A locked project may prevent you from inspecting and compiling its code.

Does PtrSafe alone make a VBA declaration compatible with 64-bit Office?

No. In the VBA editor, review the declaration's parameter and return types as well. Pointers and handles generally need LongPtr, while other values must retain the types required by the API.