ExcelDna icon indicating copy to clipboard operation
ExcelDna copied to clipboard

Is it possible to change the menu text dynamically?

Open rdejournett opened this issue 2 years ago • 4 comments

For example I have the menu like this:

<ExcelCommand(MenuName:="RoadTrip", MenuText:="----" & " v14.4.0 " & "------")>
Public Shared Sub DoNothing()
End Sub

Is there something in the code I can use to change the MenuText property? The user wants to return a number based on what the code is doing (it's driving a motor and they want to use it to return the position of the motor).

rdejournett avatar Jan 30 '23 14:01 rdejournett

I would suggest changing to use the Ribbon interface for the menus. This is a good start: https://github.com/Excel-DNA/Samples/tree/master/Ribbon

For updating the ribbon, you might like to look at this discussion and code snippets: https://groups.google.com/g/exceldna/c/5cklJD9Wm_4/m/K6KcVf3PEwAJ

govert avatar Jan 30 '23 21:01 govert

Here's a VB.NET version of the Ribbon tutorial: https://github.com/Excel-DNA/Tutorials/tree/master/Fundamentals/RibbonBasics

govert avatar Jan 30 '23 21:01 govert

Thank you!

rdejournett avatar Jan 30 '23 23:01 rdejournett

You might also be interested in the dynamicMenu control: https://stackoverflow.com/a/34033472

augustoproiete avatar Jan 31 '23 08:01 augustoproiete