How to Run Word Macros Offline with OneDrive Files
Question details
The user needs to run a Word macro that references a file in a OneDrive path without requiring an internet connection.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- A user is trying to execute a Word macro offline that inserts or accesses a document located within a OneDrive synchronization folder.
- Observed behavior
- The macro fails to execute or prompts for an internet connection because the referenced OneDrive file is online-only and has not been synchronized to the local computer.
Verify that you have temporary internet access to download and synchronize the required OneDrive files to your local drive before attempting to run your macros offline.
Set OneDrive Files to 'Always Keep on This Device'
Force OneDrive to save a local copy of the referenced documents so the macro can access them without internet connectivity.
OneDrive often uses a 'Files On-Demand' feature to save disk space, keeping files in the cloud until they are opened. To run macros offline, the referenced files must physically exist on your local hard drive.
Open File Explorer and navigate to your OneDrive folder where the macro's referenced documents are stored.
Right-click the specific file or the entire folder and select 'Always keep on this device' from the context menu.
Wait for the status icon next to the file to change from a blue cloud to a solid green circle with a white checkmark. This indicates the file is now stored locally.
Open your Microsoft Word document and run the macro. It will now successfully access the local path without requesting an internet connection.

Pause OneDrive Synchronization
Pause the OneDrive syncing process to prevent the application from attempting to contact the cloud while you run the macro.
Try WPS Office for Seamless Local Document Management
If you frequently encounter frustrating synchronization issues with Microsoft Word and OneDrive, consider switching to WPS Office. It is a free, lightweight alternative that offers excellent format compatibility and allows you to manage local files effortlessly without aggressive cloud-only restrictions.
- 1. Download and install: Download WPS Office from the official website and complete the quick installation process.
- 2. Open your macro-enabled document: Launch WPS Writer and open your existing Word document directly from your local hard drive.
- 3. Run macros locally: Execute your macros without worrying about cloud connectivity or forced online-only file prompts.

Frequently Asked Questions
Why does my Word macro ask for an internet connection?
If your macro inserts or references files stored in a OneDrive folder, Windows may attempt to download them if they are marked as 'online-only'. An active internet connection is required to fetch these placeholder files.
How do I know if my OneDrive file is stored locally?
Open File Explorer and check the status icon next to the file. A solid green circle with a white checkmark means the file is always available offline. A blue cloud icon means it is online-only.
Can I use WPS Office to run my existing Word macros?
Yes, WPS Office provides excellent compatibility with Microsoft Office formats, including VBA macro support in its advanced versions, allowing you to run your automated scripts seamlessly on local files.




