Comments (32)
@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.
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.
Please report to Microsoft too - at least from the File -> Feedback -> Send a Frown.
from exceldna.
Hi, the ribbon work, but the CTP not...
Null Reference Exception in CustomUI.CustomTaskPaneFactory.CreateCustomTaskPane
from exceldna.
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.
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.
@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.
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.
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.
If you open the AddIn (xll file) for the second time in the same Excel instance, it also works...
from exceldna.
@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.
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.
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.
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.
Sometimes these problems do get fixed before the release version 🙏
from exceldna.
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
from exceldna.
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.
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.
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.
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.
OK, I see the CustomTaskPane problem - it's very confusing what Excel is doing here . . .
from exceldna.
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.
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.
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.
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.
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
orCOMAddIns.Update()
instead of being loaded atComAddIn.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 thatComAddIn.Connect == false
at that point. - My first fix (1.7.0-rc8) was to explicitly set
ComAddIn.Connect = false
beforeComAddIn.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.
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.
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.
@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.
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.
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.
It looks like they have reverted the changes which caused this problem.
Yep, I am seeing the same.
from exceldna.
Related Issues (20)
- The Ribbon/COM Add-In helper required by add-in could not be registered HOT 5
- Embedded Resource HOT 7
- XlCall.Excel(XlCall.xlSheetNm, reference) replaces box brackets with round brackets HOT 2
- Risky use of ConcurrentDictionary HOT 3
- Assertion Failed on users machine HOT 8
- Allow use of ExcelReference from outside Excel context
- Question: addin size HOT 21
- ExcelDNA get file name
- -packed.xll not generated HOT 1
- Unable to build project with latest release HOT 1
- Registration [Error] xlfRegister call failed for function or command HOT 3
- Attack surface reduction block triggered in corporate environment HOT 1
- Could not load file or assembly 'System.Reflection.Metadata HOT 1
- Error value on multiple calls to a ThreadSafe async function HOT 7
- FrameworkReference issue with xll (.NET 6) HOT 3
- How much money is needed to make it .net 8 compatible? HOT 1
- How to access Microsoft.Office.Interop.Excel component from IRibbonControl HOT 2
- Use runtimeconfig.json when loading runtime - ASP.NET Core support under .NET 6+
- RunExcelDnaSetDebuggerOptions: open Excel file at launch HOT 2
- native runtime library is not found when packed. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from exceldna.