Microsoft 365 Error Codes

Fix Microsoft 365 Activation Script Error: Diag Is Undefined

Algirdas JasaitisAlgirdas Jasaitis Oct 14, 2026 868 views

Question details

Users are unable to activate or sign in to Microsoft 365 due to a script error.

How to Fix Microsoft 365 Activation Script Error: Diag Is Undefined
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.
Before you start

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.

Solution 1Recommended

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.

1
Download the SaRA Tool

Navigate to the official Microsoft download center and download the Microsoft Support and Recovery Assistant.

2
Install the Assistant

Run the downloaded executable file and follow the on-screen prompts to install the application on your computer.

3
Select Your Issue

Open the tool, select 'Office & Office Apps' from the main menu, and then choose the option indicating you have a problem activating Office.

4
Apply Fixes

Sign in with your Microsoft 365 credentials when prompted, and allow the tool to automatically run diagnostics and apply the necessary fixes.

Run the Microsoft Support and Recovery Assistant
Automatic Resolution: In most cases, SaRA will successfully bypass the script error and securely activate your product.
Free Microsoft Office alternative

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. 1. Download: Visit the official WPS Office website and click the free download button.
  2. 2. Install: Run the installer to quickly set up WPS Office on your computer.
  3. 3. Open and Edit: Double-click any existing Microsoft Office file to instantly open and edit it in WPS Office without signing in.
Free to use without complex sign-in scripts or activation errors.Fully compatible with Microsoft Office formats, including DOCX, XLSX, and PPTX.Lightweight installation that runs smoothly even on older hardware.Familiar tabbed interface ensures a seamless migration with zero learning curve.
microsoft office alternative - wps office

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.