There is command line tool to fix this.
1. Open Command prompt (Win+R, then type "cmd")
2. Type:
cscript "C:\Program Files\Microsoft Office\Office16\OSPP.VBS" /inpkey:{product key}3. For 32-bit Office, use "c:\Program Files (x86)\" instead
4. To verify, type:
cscript "C:\Program Files\Microsoft Office\Office16\OSPP.VBS" /dstatus