Giter VIP home page Giter VIP logo

Comments (32)

govert avatar govert commented on July 26, 2024 2

@ittegrat I made a newer Excel-DNA 1.7.0-rc8 today which did let the ribbon work for me, but the CTP is still broken - you mention rc7, which is not the right one to test for that.
What is happening in the problem Excel version is that the COM add-ins are being (partially) loaded by Excel during the early calls to Application.COMAddIns and Application.COMAddIns.Update. It's aprtly loaded in the sense that the ribbon interface GetCustomUI() is not called at this stage. Then when we call addIn.Connect = true this does not do anything for already-partly-loaded add-ins. Adding addIn.Connect = false before does an unload and allows a 'full' reload after.
But the CTP (and general Excel-DNA Com add-in loading) mechanism is confused by the extra loads and unexpected event sequence.
I know Microsoft was working on improving the COM add-in events, so that might have triggered the changes from their side.
I'm not sure how much to fiddle with this while it's a beta Excel version that is behaving like this - maybe they'll fix it or revert before a release 🤞

from exceldna.

govert avatar govert commented on July 26, 2024 2

The problem was present in the initial release of 2310 to the Current Channel - Version 2310 Build 16.0.16924.20054.
After doing an Update Now, the problem is not present in Version 2310 Build 16.0.16924.20124.

It looks like they have reverted the changes which caused this problem.

from exceldna.

govert avatar govert commented on July 26, 2024 1

Please report to Microsoft too - at least from the File -> Feedback -> Send a Frown.

from exceldna.

tomhafner avatar tomhafner commented on July 26, 2024 1

Hi, the ribbon work, but the CTP not...
Null Reference Exception in CustomUI.CustomTaskPaneFactory.CreateCustomTaskPane

from exceldna.

govert avatar govert commented on July 26, 2024 1

How big a problem do you think this is going to be if the Excel release looks like the beta?

Excel-DNA is a library used to make other add-ins, and I have no telemetry to estimate how widespread use (or use of specific features) might be.
Do I understand it right?

  • For all existing Excel-DNA based add-ins, CTPs will not show, with an error message pop-up.
  • For already installed Excel-DNA based add-ins, ribbons keep working.
  • Newly added Excel-DNA based add-ins now need a restart of Excel for the ribbon to appear.
  • Developers trying to build and debug ribbon / CTP extensions should update their Excel-DNA to the latest version.

@tomhafner Maybe you could respond to Microsoft with a suggestion that they indicate the above (or at least some helpful information) in the release notes. The relevant Excel behavior, and Excel-DNA implementation, had been stable for 15 years.

from exceldna.

slovebj avatar slovebj commented on July 26, 2024

The problem is that after updating Excel to version 2310 (16924.20002), the ribbon can display, but the CustomTaskPane (CTP) cannot. Upon investigation, it was found that the following statement is not running normally:
CustomTaskPane ctp = CustomTaskPaneFactory.CreateCustomTaskPane(typeof(CTPControl), "CTPname")。The problem was not present in earlier versions.

from exceldna.

govert avatar govert commented on July 26, 2024

@slovebj If you've tried to update your add-in project to .NET 6, you might be running into this CTP-related problem: https://groups.google.com/g/exceldna/c/onRDZLJwoBY/m/ddsjBDbsBAAJ

Otherwise, if the only change is the Excel version, please report to Microsoft.

from exceldna.

gmichaud avatar gmichaud commented on July 26, 2024

Our team is experiencing the same thing -- ribbon no longer displays when opening XLL or starting from Visual Studio, but works fine when installed from .msi.

from exceldna.

govert avatar govert commented on July 26, 2024

Hi @gmichaud - Are you running the same Beta version of Excel?
When you say "installed from .msi", do you mean a non Excel-DNA COM add-in that implements the ribbon interface, and is registered normally?

Please also press the "Send a Frown" button to report this to Microsoft.

from exceldna.

tomhafner avatar tomhafner commented on July 26, 2024

If you open the AddIn (xll file) for the second time in the same Excel instance, it also works...

from exceldna.

wh1t3cAt1k avatar wh1t3cAt1k commented on July 26, 2024

@govert it's the same ExcelDNA-based add-in which we register in the AutoOpen registry key during the MSI-based installation.

It's only the F5 from VS or double-clicking the XLL that is not working (ribbon does not get displayed).

I have already confirmed that even a complete reinstallation of Excel or cleaning up all add-in related registry keys don't help.

from exceldna.

MichaelAnckaert avatar MichaelAnckaert commented on July 26, 2024

I'm also seeing this issue on the current build: Microsoft® Excel® for Microsoft 365 MSO (Version 2310 Build 16.0.16924.20042) 64-bit. Issue also reported to Microsoft.

from exceldna.

govert avatar govert commented on July 26, 2024

If you

  • open Excel (without any add-in installed), then
  • make sure a workbook is open (a new blank or other), then
  • File -> Open the add-in
    does it display the ribbon the first time in this case?

Maybe the problem relates to how we try to get hold of the Application COM object during start-up. This has been very problematic over the years, and Microsoft have fiddled from their side often - they've broken, fixed and re-broken stuff here in the past.

from exceldna.

govert avatar govert commented on July 26, 2024

They've also been working on the add-in initialization sequence because our ad-hoc add-in loading was interfering with their add-in event raising sequence, so that's another possible cause of the problem. But that's less likely as it sounds like the problem happens with no other add-ins installed, just loading the Excel-DNA one at startup.

from exceldna.

govert avatar govert commented on July 26, 2024

Sometimes these problems do get fixed before the release version 🙏

from exceldna.

Domchix avatar Domchix commented on July 26, 2024

Same issue for users that have 2310 version, when trying to create CTP, it throws a null reference exception.
Using the overload public static CustomTaskPane CreateCustomTaskPane(object userControl, string title);
.NET 4.6.1
ExcelDna 1.5.1
image

from exceldna.

ittegrat avatar ittegrat commented on July 26, 2024

My findings are:

  • the problem starts at:
    • build 16921.20000, version 2310, September 26, 2023 on the Beta Channel
    • build 16924.20042, version 2310, October 09, 2023 on the Current Channel (Preview)
  • opening Excel and then opening the addin does not help
  • the addin seems correctly registered (File -> Options -> Add-ins displays it as active and VBA reports the ComAddin.Connect property as true)
  • reloading the addin a second time displays the ribbon
  • it works if the addin is in the XLSTART folder or if it is loaded with 'Excel Add-ins'. In the latter case, it works only from the next opening of Excel (i.e. when you register the addin for the first time in the Excel Add-ins dialog, the ribbon is displayed only if you unload and reload the addin).

Tested with ExcelDna 1.7.0-rc7 (.NET Framework) and this simple addin (rename it to *.dna) ExcelDna64.txt

from exceldna.

govert avatar govert commented on July 26, 2024

I can reproduce the problem with the Beta Channel Version 2311 Build 16.0.17005.20000 and I have reported it through the Send a Frown button. I've also added my vote to the post here: https://feedbackportal.microsoft.com/feedback/idea/bb5bcdc1-0f61-ee11-a81c-000d3ae46fcb

It doesn't seem related to getting hold of the COM objects as I first thought. The COM calls to load the Ribbon add-in seem to succeed without error.

I sometimes see a security bar flash up and then disappear (below the formula bar, above the sheet). I don't know what it says. When I add the .xll folder as a Trusted Location, that doesn't seem to happen anymore, but the ribbon still does not load.

I will investigate further . . . and other insights are very welcome.

from exceldna.

govert avatar govert commented on July 26, 2024

I think I've found a fairly safe workaround by tuning the COM add-in load calls. I'll test a bit more and then make an updated preview soon.

from exceldna.

govert avatar govert commented on July 26, 2024

OK, could you try v1.7.0-rc8 please? It looks like some toggling of the add-in properties is enough to make it work.

from exceldna.

govert avatar govert commented on July 26, 2024

OK, I see the CustomTaskPane problem - it's very confusing what Excel is doing here . . .

from exceldna.

ittegrat avatar ittegrat commented on July 26, 2024

For me, with the latest Excel beta version (17005.20000) and .Net Framework 4.8, it doesn't work; I need to reload the addin to show the Ribbon and reload one more time to be able to show the CTP.
I don't know if this info can help, but I noticed a change in Excel with the add-in user interface errors.
I enabled the option Show add-in user interface errors and I've declared a non existent procedure in the onLoad attribute of the customUI.
With the current and previous versions of Excel, if I open the program and I close and create new workbooks multiple times, and then I open the addin, Excel shows me the error multiple times. With the last working version (both on the beta and current preview channel) it shows me the error only once. In general, with the old versions I see Excel open -> n*(ctrl+w -> ctrl+n) -> load addin -> (n+3)*errors; after that, only on ctrl+n when a new window is created. With the last working version, I just see one error when I load the addin (and after that, only on ctrl+n), no matter how many times I create and destroy workbooks and windows.
This behavior is identical with both ExcelDna rc4 and rc7.

from exceldna.

govert avatar govert commented on July 26, 2024

OK, I've gone a bit further and pushed an update to NuGet as 1.7.0-rc9.
Please let me know how it looks and if you are able to test with a beta version or an Excel release version from before these troubles.

from exceldna.

HeidiSem avatar HeidiSem commented on July 26, 2024

ribbon and CTP seem to work with 1.7.0-rc9 with the latest beta version 2311 (Build 17005.200000)
Out of interest, what was the problem with the ctp?

from exceldna.

ittegrat avatar ittegrat commented on July 26, 2024

Quick tested and working both Ribbon and CTP with:

  • build 17005.20000, version 2311, October 10, 2023 on the Beta Channel (after troubles)
  • build 16924.20054, version 2310, October 13, 2023 on the Current (Preview) Channel (after troubles)
  • build 16130.20810, version 2302, October 10, 2023 on the Semi-Annual Enterprise Channel (before troubles)

I'll do more tests in the next few days.

from exceldna.

govert avatar govert commented on July 26, 2024

Out of interest, what was the problem with the ctp?

  • In the problem versions we get the COM add-in loaded at an unexpected time (with the call to either Application.COMAddIns or COMAddIns.Update() instead of being loaded at ComAddIn.Connect = true, which we expect).
  • When it is loaded at the unexpected time, the IDTExtensibility2 interface methods are called (OnConnected etc.) but the extra interface / method for ribbon support (IRibbonExtensibility.GetCustomUI) is not invoked. After the spurious load, ComAddIn.Connect = true has no effect even though checking the property before the set indicates that ComAddIn.Connect == false at that point.
  • My first fix (1.7.0-rc8) was to explicitly set ComAddIn.Connect = false before ComAddIn.Connect = true, which unloads the add-in before then loading it 'fully' (including the ribbon call).
  • Our CTP support failed in this case, because the unload from the initial spurious load removed it from an internal (Excel-DNA) collection at an unexpected time. Then with the 'proper' load we failed with an NRE.
  • The workaround in 1.7.0-rc9 is to have a 'dummy' add-in that loads and unloads in the spurious early COM calls, then switch in the real add-in just before the actual ComAddIn.Connect = true call. This seems to work OK, and the CTP tracking is not confused by spurious load / unloads.

from exceldna.

tomhafner avatar tomhafner commented on July 26, 2024

I don't know yet whether I should be happy about the solution or not, because since there is a solution, Microsoft refuses to correct it....?

Feedback from Microsoft:

Well, I’ve double checked internally, and we could share the following:

First, we were thinking if that's specific to ExcelDNA only, then the question should get to the ExcelDNA developers first and
If there is a repro with a normal XLAM or VSTO/COM add-in, we can look at it, of course.

Hence, we’ve checked the following link and found an update two days ago stated that the issue has been resolved, thus, can you please double check this at your end.

from exceldna.

chrish29 avatar chrish29 commented on July 26, 2024

Hello to add my experience as I have also noticed the ribbon not loading too. We have 2 Ribbon UI's that load on start up and in a scenario where the add in was already working it is only the 2nd Ribbon UI that doesn't appear load so we end up with half our ribbon buttons. On a clean machine it doesn't load at all!

Also, Version 2310 was posted to the Current channel last night that contains the issue. It hit my dev machine this morning,

from exceldna.

govert avatar govert commented on July 26, 2024

@chrish29 Thanks for the additional feedback and confirming the problem release to the Current channel.

Have you been able to check whether Excel-DNA version 1.7.0-rc9 fixes your two ribbon scenario?

I think I will publish a final 1.7.0 release over the weekend with the workaround as it is in 1.7.0-rc9.

from exceldna.

chrish29 avatar chrish29 commented on July 26, 2024

Hi @govert, Yes 1.7.0-rc9 does fix our ribbon scenario. We have tested it now in all sorts of environments! Thanks.

We rarely use custom task panes so haven't seen that side of things.

from exceldna.

mike3sullivan avatar mike3sullivan commented on July 26, 2024

Confirmed that 1.7.0-rc9 fixed the problems with .Net 6-based add-in and that Excel's Build 16.0.16924.20124 fixed the (embarrassingly) old v0.34.6 .Net Framework 4.7.2-based add-in.

Is there going to be any reprecussions from 1.7.0-rc9 now that Excel's behaviour has changed back?

from exceldna.

chrish29 avatar chrish29 commented on July 26, 2024

It looks like they have reverted the changes which caused this problem.

Yep, I am seeing the same.

from exceldna.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.