0

We have an existing COM-based Excel add-in, we created a JS-based add-in so we can offer similar tooling for our MAC users. JS add-in works well, but when it's added to a file opened on PC, both our COM and JS add-ins will be loaded, which is a little confusing.

Is there a way for our JS add-in to 'detect' if a specific COM add-in is also installed (so we can disable or hide the JS add-in only leaving the COM one)?

Found this similar question, but this was 5 years ago, not sure if things have changed.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
bvd
  • 1

1 Answers1

1

The Office JavaScript API (OfficeJS) doesn't provide anything for doing that at runtime. But you can specify an equivalent COM add-in in the manifest file to prevent loading your web add-in if a corresponding/specified COM add-in is installed. Here is what MS states for that:

In some cases, your Office add-in may not be able to provide all of the functionality that's available in the corresponding COM add-in. In these situations, your COM add-in may provide a better user experience on Windows than the corresponding Office add-in can provide.

You can configure your Office Add-in so that when the equivalent COM add-in is already installed on a user's computer, Office on Windows runs the COM add-in instead of the Office Add-in. The COM add-in is called "equivalent" because Office will seamlessly transition between the COM add-in and the Office Add-in according to which one is installed a user's computer.

To enable compatibility between your Office Add-in and COM add-in, identify the equivalent COM add-in in the manifest of your Office Add-in. Then Office on Windows will use the COM add-in instead of the Office Add-in, if they're both installed.

The following example shows the portion of the manifest that specifies a COM add-in as an equivalent add-in. The value of the ProgId element identifies the COM add-in and the EquivalentAddins element must be positioned immediately before the closing VersionOverrides tag.

<VersionOverrides>
  ...
  <EquivalentAddins>
    <EquivalentAddin>
      <ProgId>YourCOMAddinProgID</ProgId>
      <Type>COM</Type>
    </EquivalentAddin>
  </EquivalentAddins>
</VersionOverrides>

Read more about that in the Make your Office Add-in compatible with an existing COM add-in article.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45