Fix Excel VBA Add-In Reference Path Changes on OneDrive
Question details
Users experience broken VBA macro functionality because Excel automatically changes a shared network add-in reference path to a local OneDrive or AppData copy.

- Product
- Microsoft Excel, OneDrive
- Device & OS
- not provided
- Scenario
- Co-authoring or sharing Excel workbooks with VBA add-ins stored on a network path while OneDrive sync is active.
- Observed behavior
- Excel updates the shared add-in network path to a local OneDrive or AppData folder path, causing reference errors for other users when they open the shared workbook.
Ensure all users have access to the shared network drive where the VBA add-in is located, and temporarily pause OneDrive syncing for the affected workbook to prevent it from immediately overwriting your changes.
Use a Centrally Deployed Add-In Location
Move the VBA add-in to a centralized network location that is strictly outside of any OneDrive synced folders to prevent path mapping issues.
Excel creates a local copy of referenced files when they are synced to the cloud, changing the reference path to the local OneDrive or AppData folder. By moving the add-in completely outside of a co-authored OneDrive environment and into a dedicated, un-synced shared network drive, you prevent Excel from dynamically mapping the path to a local user folder.
Find your original .xlam add-in file in your local directory or current OneDrive folder.
Move the .xlam file to a stable, shared network drive that is completely excluded from OneDrive synchronization (e.g., P:\Forms\NEW INVOICE TEMPLATES\).
Open Excel, go to 'File' > 'Options' > 'Add-Ins'. Click 'Go...' at the bottom next to Manage Excel Add-ins.
Click 'Browse...', navigate to the new network path where you placed the .xlam file, and select it to establish a permanent network reference.

Use an Open-Event Macro to Restore the Network Path
Implement a VBA macro that forces Excel to remap the VBA add-in to the correct network path every time the workbook opens.
Try WPS Office for Stable Macro Management
If Microsoft Excel's integration with OneDrive constantly breaks your shared VBA add-in paths, consider switching to WPS Office. WPS Spreadsheet offers excellent compatibility with Excel macros without forcing unwanted cloud-path conversions on your local network files.
- 1. Download and install: Get WPS Office Free from the official website and install it on your computer.
- 2. Open your macro workbook: Launch WPS Spreadsheet and open your .xlsm or .xlam files directly.
- 3. Manage add-ins stably: Navigate to the Developer tab to manage your VBA add-ins securely from your stable network drive.

Frequently Asked Questions
Why does Excel change my VBA add-in path to OneDrive or AppData?
Excel detects a synced local copy of the referenced file in your OneDrive or AppData folder. By default, it updates the reference to this local path to ensure the file is accessible offline, which unfortunately breaks the link for other network users who do not share your exact local user path.
Can I manually edit the FullPath property of a VBA reference?
No, the FullPath property of a VBA reference is read-only in Excel. You cannot edit it directly. You must remove the incorrect reference and add a new one, either manually via the Add-Ins menu or programmatically using an open-event macro.
How do I prevent OneDrive from syncing my VBA add-ins?
You can prevent this by moving your add-in files (.xlam) to a dedicated folder that is explicitly excluded from OneDrive synchronization, or by placing them on a distinct shared network drive that sits entirely outside of the local OneDrive directory tree.




