The “Discard Changes” prompt appears in Excel for the web or desktop Excel when your authenticated cloud session expires before your latest edits are saved to SharePoint or OneDrive. This timeout is usually triggered by inactivity policies, network drops, or expired security tokens. If you click “Discard Changes,” Excel purges every uncommitted edit made since the connection dropped.
Quick Fix
Do not click “Discard Changes.” If you are in Excel for the web, leave the browser tab open, select your modified data ranges, and copy them (
Ctrl + C) into a blank local desktop workbook or text editor. If you are in desktop Excel, click File > Save a Copy to preserve your work as an independent local file before refreshing your session.
Step 1: Emergency Data Preservation
Before you attempt to reconnect, refresh, or close your session, assume that any action that reloads the application will wipe your uncommitted cache.
If You Are in Excel for the Web (Browser):
- Leave the error dialog active. Do not click “Discard Changes” or reload the page.
- If the browser allows you to interact with the grid behind the dialog:
- Click into the worksheet.
- Select the cells containing your recent edits.
- Press
Ctrl + C. - Open a local text file, Notepad, or a local desktop spreadsheet, and paste (
Ctrl + V) the raw values.
- If the dialog modal blocks cell selection:
- Duplicate the browser tab (
Right-click tab> Duplicate). - In the new tab, navigate back to the document library to see what the last saved server version contains.
- This confirms what data the cloud actually has, showing you exactly what needs to be manually rescued from your screen.
- Duplicate the browser tab (
If you lose track of which edits are committed versus unsaved during this transition, review “Refresh Recommended”: Handling versioning mismatches in the cloud..
If You Are in the Excel Desktop Application:
- Click the X on the error message or choose Cancel instead of “Discard Changes.”
- Go to File > Save As (or Save a Copy).
- Browse to a local drive location (such as your desktop or local documents folder, avoiding the synced OneDrive directory).
- Save the file under a new name (for example,
Project_Local_Rescue.xlsx). - This creates an unlinked snapshot of your work, ensuring you have zero risk of data loss when you reset the connection.
If desktop Excel crashes or closes before you can run a manual copy, you can search your local disk for temporary backup files using Troubleshooting AutoRecover failures: Where to find unsaved temp files..
Step 2: Re-authenticate and Reclaim the Cloud Session
Once your data is saved locally, you can safely re-establish your connection to the cloud tenant.
- Refresh the Authentication Token:
- In the browser, click the refresh button or press
F5. - If prompted with “Leave site? Changes that you made may not be saved,” confirm and reload.
- Sign back in with your Microsoft 365 organizational credentials.
- In the browser, click the refresh button or press
- Re-authenticate Desktop Excel:
- Look at the top-right corner of the Excel window. If you see a yellow warning triangle or an account notice reading Sign In, click it.
- Enter your corporate credentials to restore the cloud sync pipeline.
- Compare and Merge:
- Open the refreshed cloud workbook.
- Open your rescued local backup side-by-side.
- Copy the missing cells or formulas from the local backup back into the cloud document.
- Confirm that the title bar updates to read Saved before closing the window.
If multiple authors edited the same ranges while your session was disconnected, see “Merge Conflict”: Resolving co-authoring errors in Excel Online..
Step 3: Prevent Chronic Inactivity Timeouts
If you frequently encounter the “Discard Changes” warning, your Microsoft 365 environment or browser is dropping your identity token prematurely.
- Tenant Idle Session Timeout: Microsoft 365 administrators can enforce an organizational idle timeout policy (such as terminating sessions after 15 minutes of inactivity). If you work on complex spreadsheets with long gaps between data entries, request that your IT administrator review the Idle session timeout setting in the Microsoft 365 Admin Center.
- Browser Tab Sleeping: Modern web browsers (Edge, Chrome) put inactive background tabs to sleep to save memory. When a tab sleeps, its WebSocket connection to the Excel calculation server closes. Add your SharePoint domain (
https://yourtenant.sharepoint.com) to your browser’s “Never put these sites to sleep” exception list.
Summary Checklist
- Never click “Discard Changes” without first backing up your current on-screen data.
- Copy and paste modified cell ranges into a local text editor or desktop document.
- In desktop Excel, use Save a Copy to a local directory before reconnecting.
- Re-authenticate your account to re-establish the cloud streaming pipeline.
- Disable browser sleeping tabs for SharePoint and OneDrive URLs.