OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
670 stars 96 forks source link

BUG: Excel Equivalent COM Addin not working if COM addin installed after Web Addin #4014

Open georgehatg opened 8 months ago

georgehatg commented 8 months ago

In the case when a workbook is saved with a web addin installed and after that we install the equivalent COM addin and open the workbook again (with the COM addin and WEB addin installed) the web taskpane is loaded (that is wrong) while the Ribbon commands do not load (that is correct).

If the COM addin is installed and the WEB addin is installed at the same time and then we create a new workbook the WEB addin does not load as expected. If we open that document back the WEB addin is not loaded as expected.

After investigating the webextension1.xml that is included inside the XML I have found out the following snippet, that if removed from webextension1.xml the addin works as expected:

<we:extLst>
        <a:ext xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" uri="{0858819E-0033-43BF-8937-05EC82904868}">
            <we:backgroundApp state="1" runtimeId="Taskpane.Url"/>
        </a:ext>
    </we:extLst>

So it looks like there is a BUG when opening a document that contains the above web extension reference that is created by Excel when saving a workbook with a web addin embedded.

Please download following files:

EquivalentAddinWorking.xlsx EquvalentAddinNotWorking.xlsx

Environment

Expected behavior

The web addin should not be loaded if an Equivalent addin exists.

Current behavior

The web addin taskpane is loaded while it shouldn't, while the Ribbon commands are not loaded as the should.

Steps to reproduce

  1. Download EquvalentAddinNotWorking.xlsx
  2. Open the file in Excel Desktop and Install the Web Addin
  3. Save the file
  4. Now register for Free Download of the Equivalent COM addin from the following URL: https://www.cellbim.com/
  5. Install the COM addin using the Windows Installer (please pay attention to hardware requirements)
  6. Open the same file with COM addin loaded
  7. BUG: You can see that the Taskpane of the Web Addin is opened while the Ribbon Commands are not opened.
  8. Close this workbook
  9. Now download EquivalentAddinWorking.xlsx
  10. Open this file with Excel Desktop
  11. The Equivalent Addin is loaded as expected because we:backgroundApp is not included in the webextension1.xml
  12. So it looks like the SharedRuntime (we:backgroundApp) snippet above bypasses the Equivalent Addin restriction and allows opening the taskpane and the COM addin at the same time.

Link to live example(s)

Use files above. Please see reproduction steps:

https://github.com/OfficeDev/office-js/assets/156675703/4a94864b-574e-4430-ac70-198de50e7445

Wenjun-Gong commented 8 months ago

Thanks for reporting the issue. We will take a look shortly. + @zhenhuangMSFT to further isolate the root reason.

georgehatg commented 7 months ago

Hallo do you have any update on this? Have you reproduced the issue?

georgehatg commented 7 months ago

Any updates? This is a web addin blocker bug it is very important for us to know if you are going fix this.

zhenhuangMSFT commented 7 months ago

Hi @georgehatg, sorry for the delay. Currently this is a by-design behavior for shared runtime enabled add-ins due to the auto-open feature. Could you try saving the file with taskpane closed and see if it repros?

We are also evaluating the possibility of making the change as the design change could potentially impact existing scenarios that have been running for a long time.

We will keep you updated for the progress and feel free to let us know your further inquiries. Thanks for your patience!

georgehatg commented 7 months ago

Hi @georgehatg, sorry for the delay. Currently this is a by-design behavior for shared runtime enabled add-ins due to the auto-open feature. Could you try saving the file with taskpane closed and see if it repros?

We are also evaluating the possibility of making the change as the design change could potentially impact existing scenarios that have been running for a long time.

We will keep you updated for the progress and feel free to let us know your further inquiries. Thanks for your patience!

Hallo,

I dont understand the design case when an Equivalent Addin still opens while it shouldn't, can you please explain how this can impact scenarios and what could those scenario be? Is there a scenario that I use Equivalent Addin and still I want the panel to be open? Why not stop using Equivalent Addin then?

I think that the issue is in the workflow of Excel because it firsts read the webextension1.xml and then opens the panel, while it should first read the installed COM addins and then read the webextension1.xml and only open the panel if not listed in the equivalent addins.

Related to the workaround, as far as I know there is no save event so how am I supposed to save the document with a closed panel? Also what happens in the web office version, there is no save button there and I dont have any control on how you store webextension1.xml on the web.

Do you have any timeline on when this can be fixed? I think it is a release blocker not only for me but for everyone that uses OfficeJS with Equivalent Addin.

zhenhuangMSFT commented 6 months ago

Hey @georgehatg, sorry for the inconvenience caused. While we evaluate the scenarios that might be impacted, you can apply the following workaround if the document has the JS add-in persisted.

  1. Open Document Inspector following https://learn.microsoft.com/en-us/office/vba/Library-Reference/Concepts/using-the-document-inspector
  2. Inspect Content Add-ins and Task Pane Add-ins.
  3. delete all of the content add-ins and taskpane add-ins persisted in the document if any.

Please note that if you have never saved the document with the JS add-in taskpane opened, the add-in will not persist in the document and no following auto-opens will happen.

georgehatg commented 6 months ago

Hallo,

Thank you for the reply, but this "workaround" is a scenario for fixing a faulty file that was created with the JS addin first. This is not a workaround for solving the application issue because some users will definetly open the file using the web addin without the COM addin installed and re-add the add in content, so I can not ask them to make that process in daily basis.

What I am asking is not how to fix a "faulty" file, I already know how to do this. What I am asking is to be able to use the EquivalentAddin correctly and that is if a COM addin is installed it should not launch the web addin in all cases, even if the file was saved from the JS addin initially or opened to JS after the COM addin.

Do you think this will be fixed? Unfortuanatelly this BUG completely blocks are development plans for OfficeJS and we are very unsure if we should proceed with development or not, can you please give us an idea of then this could be possibly fixed?

Thank you

zhenhuangMSFT commented 6 months ago

Hey @georgehatg, I understand and mostly agree with you. We are working on the fix but please be patient as we definitely need to assess the potential impact it might have.

georgehatg commented 5 months ago

Any Updates on this issue? It is almost 4 months and it is still not fixed...

m-hellesen commented 5 months ago

Hi there, we are currently evaluating making a series of changes to this feature, and this is one of the feedback items we are looking at to include. Please bear with us as we work through making this feature better all up!

wh1t3cAt1k commented 2 months ago

We had a number of support escalations regarding this issue recently.

Please consider increasing the priority of this bug! It feels like the equivalence mechanism protection is "one-sided", because it works properly if you install JS after COM, but doesn't work correctly if you install COM after having used JS.

Our customers said it was very annoying to always see the side panel initialised despite the fact that they don't want to use the JS add-in yet.

I proposed a workaround with the document inspector, however they have dozens of documents and it is poor user experience to manually clean up the task pane add-in from every one of them – they were not happy.

Velixo internal tracking item