ExcelDna icon indicating copy to clipboard operation
ExcelDna copied to clipboard

The ribbon is no longer loaded since today's Excel Beta Version 2310 Build 16924.20002.

Open tomhafner opened this issue 3 years ago • 32 comments

The ribbon is not loaded in either old (Framework 4.6) or current ExcelDNA (.net6). It still worked yesterday with Excel version 16924.20000.

tomhafner avatar Oct 02 '23 10:10 tomhafner

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

govert avatar Oct 02 '23 10:10 govert

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.

slovebj avatar Oct 04 '23 01:10 slovebj

@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.

govert avatar Oct 04 '23 03:10 govert

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.

gmichaud avatar Oct 11 '23 12:10 gmichaud

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.

govert avatar Oct 11 '23 13:10 govert

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

tomhafner avatar Oct 11 '23 13:10 tomhafner

@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.

wh1t3cAt1k avatar Oct 11 '23 14:10 wh1t3cAt1k

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.

MichaelAnckaert avatar Oct 11 '23 20:10 MichaelAnckaert

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.

govert avatar Oct 11 '23 21:10 govert

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.

govert avatar Oct 11 '23 21:10 govert

Sometimes these problems do get fixed before the release version 🙏

govert avatar Oct 11 '23 21:10 govert

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

Domchix avatar Oct 12 '23 07:10 Domchix

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

ittegrat avatar Oct 12 '23 11:10 ittegrat

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.

govert avatar Oct 15 '23 09:10 govert

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.

govert avatar Oct 15 '23 12:10 govert

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.

govert avatar Oct 16 '23 10:10 govert

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

tomhafner avatar Oct 16 '23 11:10 tomhafner

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

govert avatar Oct 16 '23 11:10 govert

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.

ittegrat avatar Oct 16 '23 13:10 ittegrat

@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 🤞

govert avatar Oct 16 '23 13:10 govert