logo
search
VBA & Macro Problems

Fix Excel VBA Cannot Save Changes to Workbook Modified by Another User

Maira MehtabMaira Mehtab Sep 22, 2026 869 views

Question details

The user is unable to save VBA code changes in an XLSM workbook because Excel reports it has been modified by another user.

Product
Microsoft Excel, OneDrive
Device & OS
Mac and Windows
Scenario
Transferring and editing a macro-enabled workbook (XLSM) across Mac and Windows computers using OneDrive synchronization.
Observed behavior
Excel prevents saving VBA modifications, displaying an error that the workbook was modified by another user.
Before you start

Before troubleshooting, manually export your VBA modules or save a local copy of your XLSM workbook to your desktop to ensure you do not lose any recent code modifications.

Solution 1Recommended

Save the Workbook Locally and Resolve Sync Conflicts

Disconnect the file from the active OneDrive sync process to allow VBA changes to save without cross-platform interference.

When transferring files between Mac and Windows environments, OneDrive background syncing can occasionally lock the file. This makes the Excel VBA editor assume that another user (which is actually the sync client) is modifying the document.

1
Save a copy locally

Click 'File' then 'Save As' and choose a local folder on your computer, such as the Desktop, rather than a OneDrive directory.

2
Pause OneDrive syncing

Click the OneDrive cloud icon in your system tray or menu bar, select 'Help & Settings', and click 'Pause syncing'.

3
Update VBA code

Open the local copy of the XLSM file, press ALT + F11 to open the VBA editor, apply your changes, and hit Save.

4
Replace the cloud version

Once saved successfully, resume OneDrive syncing and manually replace the older cloud file with your newly updated local workbook.

Free Microsoft Office alternative

Try WPS Office for Seamless Macro and VBA Handling

If OneDrive and Microsoft Excel sync conflicts keep interrupting your workflow, consider switching to WPS Office. It provides a lightweight, highly compatible environment for your spreadsheets with excellent support for VBA and macro-enabled workbooks without heavy background syncing conflicts.

  1. 1. Download and Install WPS Office: Visit the official WPS website and install the lightweight suite on your PC or Mac.
  2. 2. Open Your XLSM File: Launch WPS Spreadsheet and drag-and-drop your Excel macro-enabled workbook into the workspace.
  3. 3. Edit VBA Macros Seamlessly: Access the Developer tab to open the VBA editor, write your macros, and save the document locally without persistent sync interruptions.
Fully compatible with Microsoft Excel formats, including XLSM and XLSX.Robust built-in support for VBA and macros to automate your complex tasks.Lightweight installation and smooth performance on Windows, Mac, and Linux.Free to use with a familiar, easy-to-navigate tabbed interface.Reduces cloud-sync file locking issues by offering stable local editing.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Excel say a file is modified by another user when I am the only one editing?

This often happens when cloud storage services like OneDrive or SharePoint sync a file in the background while you are editing. The synchronization process creates a temporary lock that Excel interprets as another user's activity.

Are XLSM files fully supported on Excel for Mac?

Yes, Excel for Mac supports XLSM files, but the VBA environment differs slightly from Windows. Certain Windows-specific API calls, file path structures, or ActiveX controls will not function natively on a Mac.

How can I force Excel to save my VBA changes during a lock?

If you encounter a save lock, export your VBA modules by right-clicking the module in the editor and selecting 'Export File'. Save them to a safe local folder, restart Excel, and re-import them into a fresh copy of your workbook.

Does WPS Office support XLSM and VBA macros?

Yes, WPS Office offers excellent compatibility with Microsoft Office formats, including XLSM, and includes a built-in VBA editor for creating, modifying, and running your existing macros smoothly.