Office Compatibility Issues

How to Fix Excel 365 Compatibility Issues with Excel 2010 XLSM Files and VBA

Ayan MasoodAyan Masood Nov 10, 2026 869 views

Question details

The user needs to know how to ensure Excel 2010 XLSM workbooks and VBA macros function correctly when opened in Microsoft Excel 365.

How to Fix Excel 365 Compatibility Issues with Excel 2010 XLSM Files and VBA
Product
Microsoft Excel
Device & OS
not provided
Scenario
Opening and running legacy Excel 2010 XLSM files with VBA macros in the newer Excel 365 environment.
Observed behavior
While generally compatible, users may experience macro security blocks, 64-bit Office API declaration errors, or missing obsolete library references.
Before you start

Ensure you have a backup copy of your original Excel 2010 XLSM file before making any VBA code modifications in Excel 365, and verify that the file comes from a trusted source before enabling macros.

Solution 1Recommended

Update VBA Code for 64-bit Compatibility and Fix References

Modify Windows API declarations and repair missing library references to make the VBA code compatible with 64-bit Excel 365.

When migrating from Excel 2010 (often 32-bit) to Excel 365 (usually 64-bit), Windows API declarations in VBA must be updated. Additionally, older library references may become obsolete and need to be repaired.

1
Open the VBA Editor

Open the XLSM file in the Excel 365 desktop application and press Alt + F11 to open the VBA Editor.

2
Repair Missing References

Go to Tools > References in the top menu. Uncheck any libraries marked as 'MISSING', then locate and check their updated equivalents in the list.

3
Update API Declarations

Locate any 'Declare' statements in your VBA modules and add the 'PtrSafe' keyword (e.g., 'Declare PtrSafe Function').

4
Adjust Data Types

Update data types that handle pointers or handles from 'Long' to 'LongPtr' to ensure 64-bit compatibility.

5
Compile and Save

Click Debug > Compile VBAProject to ensure no syntax errors remain, then save the workbook.

Update VBA Code for 64-bit Compatibility and Fix References
Excel for the Web Limitation: Excel for the web can store and preserve XLSM files but cannot execute VBA macros. You must use the desktop application to run or edit VBA.
Free Microsoft Office alternative

Try WPS Office for Seamless Spreadsheet Compatibility

If you are struggling with Microsoft Office version compatibility or subscription costs, WPS Office provides a lightweight, highly compatible, and free alternative. It supports standard Microsoft Excel formats, including XLS, XLSX, and CSV, with a familiar user interface that requires no learning curve.

  1. 1. Download WPS Office: Download and install WPS Office from the official website.
  2. 2. Open WPS Spreadsheets: Launch WPS Spreadsheets and click File > Open.
  3. 3. Select Your File: Select your Excel workbook to view and edit your data seamlessly.
Fully compatible with Microsoft Excel formats (.xlsx, .xls, .csv).Free to download and use with a lightweight installation package.Familiar tabbed interface makes migrating from MS Office effortless.Built-in advanced spreadsheet tools for data analysis and visualization.
microsoft office alternative - wps office

Frequently Asked Questions

Why do my Excel 2010 macros show a 'Compile error' in Excel 365?

This usually happens because Excel 365 is 64-bit, while Excel 2010 was likely 32-bit. You need to update your Windows API declarations by adding the 'PtrSafe' attribute and changing 'Long' to 'LongPtr' for handles and pointers.

Can I run XLSM macros in Excel for the web?

No, Excel for the web does not support running or editing VBA macros. You can upload and view the XLSM file, but you must open it in the desktop version of Excel to execute the macros.

How do I fix 'Missing' references in my VBA project?

Open the VBA Editor (Alt + F11), go to Tools > References, and look for items starting with 'MISSING:'. Uncheck these items, then scroll down to find and check the updated version of that specific library for your current Office installation.