Sometimes Windows can keep an old Microsoft Office license saved on your computer, even after you’ve installed a newer version. This can cause the wrong version to appear in Word, Excel, or other Office programs — for example, you might have installed Office 2024, but in Word’s Account section it still shows Office 2021 or Office 2016, even though those versions aren’t installed.
When this happens, the old license key is still stored on your system and needs to be removed manually. This guide will walk you through the steps to clear any leftover Office keys so you can activate the correct version of Office.
Step-by-step: How to remove old Office product keys
Follow these steps carefully.
1. Sign out and close all Office apps
Open any Office program (like Word)
Sign out from the account (if logged in)
Close all Office windows completely
2. Open the Command Prompt
Click the Start button (Windows icon) in the bottom-left corner of your screen.
In the search box, type cmd.
In the search results, right-click Command Prompt and select Run as administrator.
When asked “Do you want to allow this app to make changes to your device?”, click Yes.
This opens a black command window.
3. Find the correct folder for Office
In the Command Prompt, type one of the following (depending on your installation):
cd C:\Program Files\Microsoft Office\Office16
If you get an error or the folder doesn’t exist, try this instead:
cd C:\Program Files (x86)\Microsoft Office\Office16
Then press Enter after either command.
4. List the active Office product keys
Type the following command and press Enter:
cscript ospp.vbs /dstatus
This shows a list of all Office product keys currently installed. Look at the last five characters of each key — you’ll use these in the next step.
5. Remove the product key
To remove a key, type the following command, replacing xxxxx with the last five digits of the key you want to remove:
cscript ospp.vbs /unpkey:xxxxx
You can repeat this for each key you’d like to remove.
6. Restart your computer
Once all old keys are removed, restart your PC to finish the cleanup.
7. Reactivate Office
After restarting:
Open any Office program
Enter your correct product key when prompted, or go to Account > Activation to enter it manually.
Still seeing the wrong version?
If Office still shows the wrong version (e.g. Office 2021 instead of Office 2024), you can try this alternative method: Fix Office showing as the wrong version