How to Prevent Excel Macros from Overwriting Data in OneDrive
Question details
A large team of over 100 users works with a shared Excel macro-enabled workbook on OneDrive, but concurrent data retrieval and uploading cause users' changes to be overwritten.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Multiple managers are running macros to retrieve, edit, and upload team data simultaneously in a shared OneDrive workbook.
- Observed behavior
- When multiple users run the upload macro at the same time, shared interface sheets and data ranges overwrite other users' modifications instead of merging properly.
Before modifying your workbook architecture or VBA code, ensure you have created a complete backup of the primary macro-enabled file and ask users to temporarily pause data uploads.
Audit and Modify the Macro Code for Concurrent Use
Review the existing VBA macros and implement unique identifiers to update specific records rather than writing to absolute data ranges.
Macros typically execute locally and push changes based on static cell ranges. In a co-authoring environment like OneDrive, this bypasses native merge logic, leading to overwriting.
To fix this, the macro must be rewritten to identify exactly which rows are being edited or added, using unique identifiers for every single record.
Open the VBA Editor (Alt + F11) and locate the upload macro. Determine whether the current code copies entire filtered ranges or clears existing data before pasting.
Add a dedicated column in your main database sheet for a Unique ID (e.g., an auto-incrementing number or GUID). Ensure the retrieval macro pulls this ID alongside the data.
Change the macro so that instead of pasting a block of data, it loops through the submitted changes, searches for the matching Unique ID in the main sheet, and updates only the specific cells for that row.
If users are adding new records, program the macro to find the next available empty row at the bottom of the dataset (e.g., using 'End(xlUp).Row') to append new data without overwriting existing entries.
Restructure the Workbook for Multi-User Data Isolation
Redesign the workflow to prevent over 100 users from interacting with the exact same interface sheet, which causes inevitable collision.
Try WPS Office for Seamless Spreadsheet Management
If managing complex VBA workbooks and concurrent editing limits in Microsoft Excel is causing recurring data conflicts, consider transitioning to WPS Office. It provides robust spreadsheet tools, excellent format compatibility, and a lightweight environment designed for modern collaboration.
- 1. Download WPS Office: Visit the official WPS website to download the free installation package for your operating system.
- 2. Install the Software: Run the installer and follow the simple on-screen instructions to set up the software.
- 3. Open Your Spreadsheets: Double-click your existing spreadsheet files to open them directly in WPS Spreadsheet with all formatting preserved.

Frequently Asked Questions
Why do my Excel macros cause data overwriting in shared OneDrive files?
Macros execute locally and often write data to statically defined cell ranges. Because they happen instantaneously and bypass OneDrive's native cell-by-cell co-authoring merge logic, one user's macro execution can easily overwrite the data just pasted by another user's macro.
Can Excel handle over 100 concurrent users running macros?
While Excel supports co-authoring, having over 100 concurrent users triggering VBA macros to write data to the same workbook is generally unsupported and highly prone to sync conflicts, data corruption, and overwriting. A database backend is recommended for this scale.
How do I update specific rows via macro without affecting other users?
You need to assign a Unique Identifier (ID) to every row of data. Your macro must be written to search for this specific ID in the master sheet and update only the corresponding cells in that exact row, rather than copying and pasting large blocks of data.




