Fix Microsoft 365 Activation Script Error: Diag Is Undefined
Question details
Users are unable to activate or sign in to Microsoft 365 due to a script error.

- Product
- Microsoft 365
- Device & OS
- not provided
- Scenario
- Attempting to sign in and activate Microsoft 365 desktop applications.
- Observed behavior
- A script error dialog box pops up stating that 'Diag' is undefined in odc.officeapps.live.com, which completely prevents the activation process from completing.
Ensure your computer has a stable internet connection and verify that your system time and date are set correctly, as incorrect time settings can interfere with security certificates during activation.
Run the Microsoft Support and Recovery Assistant
Use Microsoft's official diagnostic tool to automatically identify and resolve underlying Office activation issues.
The Microsoft Support and Recovery Assistant (SaRA) is designed specifically to fix common Office sign-in and activation problems by resetting corrupted configuration files and checking network blocks.
Navigate to the official Microsoft download center and download the Microsoft Support and Recovery Assistant.
Run the downloaded executable file and follow the on-screen prompts to install the application on your computer.
Open the tool, select 'Office & Office Apps' from the main menu, and then choose the option indicating you have a problem activating Office.
Sign in with your Microsoft 365 credentials when prompted, and allow the tool to automatically run diagnostics and apply the necessary fixes.

Verify Subscription and Organizational Status
Ensure your Microsoft 365 account has an active license that permits desktop application usage.
Skip Activation Hassles with WPS Office
If persistent Microsoft 365 activation errors are disrupting your work, consider switching to WPS Office. It provides a robust, lightweight, and free alternative with a highly familiar user interface, allowing you to bypass frustrating subscription scripts and get straight to your documents.
- 1. Download: Visit the official WPS Office website and click the free download button.
- 2. Install: Run the installer to quickly set up WPS Office on your computer.
- 3. Open and Edit: Double-click any existing Microsoft Office file to instantly open and edit it in WPS Office without signing in.

Frequently Asked Questions
Why does the 'Diag is undefined' script error occur during activation?
This error generally happens when the built-in browser component used by the Office sign-in window fails to fully load the authentication scripts from Microsoft's servers (odc.officeapps.live.com). This can be caused by network restrictions, antivirus software blocks, or corrupted browser cache.
Can clearing my browser cache resolve this activation script error?
Yes, because the Microsoft 365 sign-in prompt relies on your system's default web browser settings (often Microsoft Edge or Internet Explorer components). Clearing your browser cache and cookies can sometimes force the script to load properly on your next attempt.
What should I do if the Support and Recovery Assistant cannot fix the error?
If the SaRA tool fails, try repairing your Microsoft Office installation via the Windows Control Panel (Programs and Features > Change > Online Repair). If the issue persists on a corporate network, ask your IT admin to ensure that odc.officeapps.live.com is whitelisted in the company's firewall.




