Fix Excel VBA Cannot Save Changes to Workbook Modified by Another User
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 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.
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.
Click 'File' then 'Save As' and choose a local folder on your computer, such as the Desktop, rather than a OneDrive directory.
Click the OneDrive cloud icon in your system tray or menu bar, select 'Help & Settings', and click 'Pause syncing'.
Open the local copy of the XLSM file, press ALT + F11 to open the VBA editor, apply your changes, and hit Save.
Once saved successfully, resume OneDrive syncing and manually replace the older cloud file with your newly updated local workbook.
Seek Advanced Help on Developer Forums
Since cross-platform VBA and OneDrive sync issues can involve complex programming environment bugs, consulting developer communities is highly recommended.
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. Download and Install WPS Office: Visit the official WPS website and install the lightweight suite on your PC or Mac.
- 2. Open Your XLSM File: Launch WPS Spreadsheet and drag-and-drop your Excel macro-enabled workbook into the workspace.
- 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.

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.




