ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel Addin and Delegates in C# (https://www.excelbanter.com/excel-programming/284743-excel-addin-delegates-c.html)

Claude Vernier

Excel Addin and Delegates in C#
 

Hi!

English is not my first language, please excuse me if I'm
not clear enough...

I made an Addin for Excel using C#.
My Addin is in two parts, the first one is installed on
the client and registered as an Addin.
The Addin provides a button in the toolbar and entries in
the contextual menu.

Clicking on either one, the second part is loaded and
contains most of the functionalities.
My problem is in the first part but I can't update it, I
must improve it by upgrading the second part.

In the first part, I added a delegate to the right-click
event and wrote a function for it:

public void OnRightClick( object sender,
Excel.Range oCell, ref bool bCancel )

In this function, I do some tests and if those tests
succeeds I add entries in the contextual menu that calls
functions in the second DLL that is loaded via Reflection.

The bug I must fix is that, the function "OnRightClick"
is called for each cell in the selected range
concerned by the right-click.

What I'd like to do is, to access the list of delegates
for this event and replace the function
that is called by a new function that would be inside the
second part.

Is that clear enough?? Is there a way ??

Thanks for any help!!
Claude



All times are GMT +1. The time now is 10:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com