How to hook ribbon button click event from external application?
How to hook ribbon button click event from external application?
===================================================
We don't know anything the environment your users work in, but if it's a corporate Internet what you could do is deploy the dll files on the Intranet (or a standard network) so that the Excel files can "find" the other elements of the solution no matter who opens them.
If the Excel file is supposed to go outside the company, then the solution would have to be in the Internet. Or you'd have to forgoe VSTO totally and stick with an integrated VBA solution.
The Ribbon by design is not open to change by any outside application - this is in essence a security measure to prevent "bad" applications from hooking into the Office application. A Ribbon customization can be added to the (closed) OpenXML file "package", making it Workbook-specific - in this case it binds to VBA code in the workbook. It can be defined as part of a VSTO solution for a document-level customization (it sounds like this may be your "current working solution"). Or it can be part of a COM Add-in - which means it's available to the entire application.
You could continue to work with the CommandBars object model, it's just that all CommandBar customizations will be in the Add-ins tab.
浙公网安备 33010602011771号