Fix Excel Switching to Primary Microsoft 365 Account
Question details
Microsoft Excel unexpectedly switches from a secondary user's account to the primary Microsoft 365 Family account.

- Product
- Microsoft Excel
- Device & OS
- Windows
- Scenario
- Collaborating or sharing Excel files while using a Microsoft 365 Family subscription.
- Observed behavior
- Excel automatically reverts to the primary account identity, causing the wrong user identity to be displayed when authoring or sharing files.
Ensure you have administrator privileges on your Windows PC, as you will need to run an elevated Command Prompt to manage Microsoft Office licenses.
Remove Obsolete Office Licenses via Command Prompt
Use the built-in Office script to find and delete outdated product keys that are causing account conflicts.
Often, older Microsoft Office installations leave behind cached licenses. This causes Excel to default to the primary Microsoft 365 account. Clearing these old keys forces Excel to use the correct current account.
Click the Windows Start button, type 'cmd', right-click on 'Command Prompt', and select 'Run as administrator'.
Type 'cd C:\Program Files\Microsoft Office\Office16' (or 'Program Files (x86)' for 32-bit versions) and press Enter.
Type 'cscript ospp.vbs /dstatus' and press Enter. Review the output to locate the last 5 characters of the installed product key for the obsolete license.
Type 'cscript ospp.vbs /unpkey:XXXXX' (replace XXXXX with the 5 characters you found) and press Enter to delete the conflicting key.

Clear Saved Microsoft Office Credentials
Removing cached credentials from Windows forces Excel to prompt for a fresh login, preventing it from automatically defaulting to the primary user profile.
Switch to WPS Office to Avoid Complex License Issues
If managing Microsoft 365 accounts, family subscriptions, and conflicting licenses is becoming a hassle, consider switching to WPS Office. It provides a lightweight, free alternative with no complicated account syncing issues.
- 1. Download the Installer: Visit the official WPS website to download the free WPS Office suite.
- 2. Install WPS Office: Run the downloaded setup file and follow the straightforward on-screen instructions.
- 3. Open Your Spreadsheets: Launch WPS Spreadsheets and open your existing .xlsx files directly without any formatting loss.

Frequently Asked Questions
Why does Microsoft 365 keep reverting to the primary account?
This typically happens when Windows has cached credentials or old product keys from a previous Office installation. Excel detects these leftover files and forces the application to authenticate with the primary user profile instead of your secondary account.
Will removing my Office license key via Command Prompt uninstall Excel?
No, running the ospp.vbs /unpkey command only removes the activation key from the system registry. Your software and files remain intact. You will simply be prompted to sign in again to activate the software with the correct account.
How do I ensure my correct identity appears when sharing Excel files?
Once you clear the obsolete credentials from Credential Manager and remove old licenses, restart Excel and sign in with your secondary account. Your correct name and email will then automatically appear as the author when collaborating or sharing.
Where can I find the Windows Credential Manager?
You can locate the Credential Manager by opening the Windows Start menu and typing 'Credential Manager'. It is also accessible through the Windows Control Panel under the 'User Accounts' section.




