Share via

Modify Excel ribbon ui in runtime

EuroEager2008 171 Reputation points
2021-12-22T10:19:36.187+00:00

Is it possible to instantiate a Microsoft.Office.Interop.Excel.Application and then modify the ribbon by C# and finally load some workbooks which may be accessed by callbacks to C# from these ribbon controls?
To be a bit more specific, I want to do this out-of-process from a WPF or similar application.

Id so, please hint to some code to getting started.
(All I have found involves using VSTO which I cannot use for certain reason, which most important is that I cannot be stuck with the old "full framework", .Net 6 compatibility is mandatory, further I dont want the workbooks or Excel installation to be modified in any way ragarding the ribbon

I mean just modifying volatilely ("in memory") which is gone after Microsoft.Office.Interop.Excel.Application.Quit() and thus only useful for the lifetime of the Microsoft.Office.Interop.Excel.Application object.

Microsoft 365 and Office | Development | Other
0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.