Test your Office Add-in on Internet Explorer 11

Important

Internet Explorer still used in Office Add-ins

Some combinations of platforms and Office versions, including perpetual versions through Office 2019, still use the webview control that comes with Internet Explorer 11 to host add-ins, as explained in Browsers used by Office Add-ins. We recommend (but don't require) that you continue to support these combinations, at least in a minimal way, by providing users of your add-in a graceful failure message when your add-in is launched in the Internet Explorer webview. Keep these additional points in mind:

  • Office on the web no longer opens in Internet Explorer. Consequently, AppSource no longer tests add-ins in Office on the web using Internet Explorer as the browser.
  • AppSource still tests for combinations of platform and Office desktop versions that use Internet Explorer, however it only issues a warning when the add-in does not support Internet Explorer; the add-in is not rejected by AppSource.
  • The Script Lab tool no longer supports Internet Explorer.

If you plan to support older versions of Windows and Office, your add-in must work in the embeddable browser control that is based on Internet Explorer 11 (IE11). You can use a command line to switch from more modern runtimes used by add-ins to the Internet Explorer 11 runtime for this testing. For information about which versions of Windows and Office use the Internet Explorer 11 web view control, see Browsers used by Office Add-ins.

Important

Internet Explorer 11 doesn't support JavaScript versions later than ES5. If you want to use the syntax and features of ECMAScript 2015 or later, you have two options:

  • Write your code in ECMAScript 2015 (also called ES6) or later JavaScript, or in TypeScript, and then compile your code to ES5 JavaScript using a compiler such as babel or tsc.
  • Write in ECMAScript 2015 or later JavaScript, but also load a polyfill library such as core-js that enables IE to run your code.

For more information about these options, see Support older Microsoft browsers and Office versions.

Also, Internet Explorer 11 doesn't support some HTML5 features such as media, recording, and location. To learn more, see Determine the browser the add-in is running in at runtime.

Note

  • Office on the web can't be opened in Internet Explorer 11, so you can't (and don't need to) test your add-in on Office on the web with Internet Explorer.

  • Internet Explorer's Enhanced Security Configuration (ESC) must be turned off for Office Web Add-ins to work. If you're using a Windows Server computer as your client when developing add-ins, note that ESC is turned on by default in Windows Server.

Switch to the Internet Explorer 11 webview

Tip

In recent versions of Office, one way to identify the webview control that Office is using is through the personality menu on any add-in where it's available. (The personality menu isn't supported in Outlook.) Open the menu and select Security Info. In the Security Info dialog on Windows, the Runtime reports Microsoft Edge, Microsoft Edge Legacy, or Internet Explorer. The runtime isn't included on the dialog in older versions of Office.

There are two ways to switch the Internet Explorer webview. You can run a simple command in a command prompt, or you can install a version of Office that uses Internet Explorer by default. We recommend the first method, but you should use the second in the following scenarios.

  • Your project was developed with Visual Studio and IIS. It isn't node.js-based.
  • You want to be absolutely robust in your testing.
  • You can't use the Beta channel for Microsoft 365 on your development computer.
  • You're developing on a Mac.
  • If for any reason the command line tool doesn't work.

Switch via the command line

If your project is node.js-based (that is, not developed with Visual Studio and Internet Information server (IIS)), you can force Office on Windows to use Edge Legacy or Internet Explorer to run add-ins, even if you have a combination of Windows and Office versions that would normally use a more recent browser. For more information about which browsers are used by various combinations of Windows and Office versions, see Browsers used by Office Add-ins.

Note

The tool that is used to force the change in browser is supported only in the Beta subscription channel of Microsoft 365. Join the Office Insider program and select the Beta Channel option to access Office Beta builds. See also About Office: What version of Office am I using?.

Strictly, it is the webview switch of this tool (see Step 2) that requires the Beta channel. The tool has other switches that do not have this requirement.

  1. If your project was not created with the Yeoman generator for Office Add-ins tool, you need to install the office-addin-dev-settings tool. Run the following command in a command prompt.

    npm install office-addin-dev-settings --save-dev
    

    Important

    The office-addin-dev-settings tool is not supported on Mac.

  2. Specify the browser that you want Office to use with the following command in a command prompt in the root of the project. Replace <path-to-manifest> with the relative path, which is just the manifest filename if it is in the root of the project. Replace <webview> with either ie or edge-legacy.

    npx office-addin-dev-settings webview <path-to-manifest> <webview>
    

    The following is an example.

    npx office-addin-dev-settings webview manifest.xml ie
    

    You should see a message in the command line that the webview type is now set to IE (or Edge Legacy).

  3. When you're finished, set Office to resume using the default browser for your combination of Windows and Office versions with the following command.

    npx office-addin-dev-settings webview <path-to-manifest> default
    

Install a version of Office that uses Internet Explorer

Use the following procedure to install either a version of Office (downloaded from a Microsoft 365 subscription) that uses the Microsoft Edge Legacy webview (EdgeHTML) to run add-ins or a version that uses Internet Explorer (Trident).

  1. In any Office application, open the File tab on the ribbon, and then select Office Account or Account. Select the About host-name button (for example, About Word).

  2. On the dialog that opens, find the full xx.x.xxxxx.xxxxx build number and make a copy of it somewhere.

  3. Download the Office Deployment Tool.

  4. Run the downloaded file to extract the tool. You are prompted to choose where to install the tool.

  5. In the folder where you installed the tool (where the setup.exe file is located), create a text file with the name config.xml and add the following contents.

    <Configuration>
      <Add OfficeClientEdition="64" Channel="SemiAnnual" Version="16.0.xxxxx.xxxxx">
        <Product ID="O365ProPlusRetail">
          <Language ID="en-us" />
        </Product>
      </Add>
    </Configuration>
    
  6. Change the Version value.

    • To install a version that uses Edge Legacy, change it to 16.0.11929.20946.
    • To install a version that uses Internet Explorer, change it to 16.0.10730.20348.
  7. Optionally, change the value of OfficeClientEdition to "32" to install 32-bit Office, and change the Language ID value as needed to install Office in a different language.

  8. Open a command prompt as an administrator.

  9. Navigate to the folder with the setup.exe and config.xml files.

  10. Run the following command.

    setup.exe /configure config.xml
    

    This command installs Office. The process may take several minutes.

  11. Clear the Office cache.

Important

After installation, be sure that you turn off automatic updating of Office, so that Office isn't updated to a version that doesn't use webview you want to work with before you've completed using it. This can happen within minutes of installation. Follow these steps.

  1. Start any Office application and open a new document.
  2. Open the File tab on the ribbon, and then select Office Account or Account.
  3. In the Product Information column, select Update Options, and then select Disable Updates. If that option isn't available, then Office is already configured to not update automatically.

When you are finished using the old version of Office, reinstall your newer version by editing the config.xml file and changing the Version to the build number that you copied earlier. Then repeat the setup.exe /configure config.xml command in an administrator command prompt. Optionally, re-enable automatic updates.

See also