0
votes

I'm trying to use the Office JavaScript DialogApi 1.1 in Excel. According to the documentation it looks like it should work with my version but it does not seem to be installed.

The requirement set indicates that it is not supported and the object Office.context.ui is undefined at runtime.

Am I missing something or is this just not supported with my version of Excel?

Versions:
Windows 10
Microsoft Excel 2016 MSO (16.0.4849.1000) 32-bit

taskpane.js

Office.onReady(info => {
  if (!Office.context.requirements.isSetSupported("DialogApi", 1.1)) {
    // I end up here and Office.context.ui === undefined    
    console.log('DialogApi is not supported.')
  }
});

taskpane.html

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Contoso Task Pane Add-in</title>

    <!-- Office JavaScript API -->
    <script
      type="text/javascript"
      src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js"
    ></script>
  </head>

  <body>
  </body>
</html>

manifest.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="TaskPaneApp">
  <Id>99999999-9999-9999-9999-999999999999</Id>
  <Version>1.0.0.0</Version>
  <ProviderName>Contoso</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <DisplayName DefaultValue="office-addon"/>
  <Description DefaultValue="A template to get started."/>
  <IconUrl DefaultValue="https://localhost:3000/assets/icon-32.png"/>
  <HighResolutionIconUrl DefaultValue="https://localhost:3000/assets/icon-80.png"/>
  <SupportUrl DefaultValue="https://www.contoso.com/help"/>
  <AppDomains>
    <AppDomain>https://localhost:3000</AppDomain>
  </AppDomains>
  <Hosts>
    <Host Name="Workbook"/>
  </Hosts>
  <DefaultSettings>
    <SourceLocation DefaultValue="https://localhost:3000/taskpane.html"/>
  </DefaultSettings>
  <Permissions>ReadWriteDocument</Permissions>
</OfficeApp>
2
Is your version really 10.0.4849.100 or is it 16.0.4849.100? - Rick Kirkham
Thanks for catching the typo. It's really version 16.0.4849.1000. - Ryan Harvey
I'm trying to get some help internally. - Rick Kirkham

2 Answers

1
votes

The Microsoft engineers think that what has probably happened is that the DLL that Office uses to report its version in the UI was updated on your machine, but that other DLLs that should have been updated at the same time were not. This can happen if the user elects to apply security updates, but not other updates. When Office updates are applied through Microsoft Update, all of the Office DLLs should be updated together automatically. In cases where updates are manually applied, some Office DLLs may not be included in the update. You need to apply the osfclient-x-none MSP patch and verify that the osf.dll is at least version 16.0.4390.1000.

To apply updates individually, this page lists the latest Office 2016 update files. Look for the osfclient-x-none update.

-1
votes

Can you try to open this link https://appsforoffice.microsoft.com/lib/1/hosted/excel-win32-16.01.js with IE/Edge and paste back the version as below: /* * @overview es6-promise - a tiny implementation of Promises/A+. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) * @license Licensed under MIT license * See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE * @version 2.3.0 */

We are wondering whether there are some local cache causing the latest version is not fetched.