Excel addin from C# - Trap excel events

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
Am developing an addin for Excel using C#. When i try to trap the
SheetBeforeRightClick event(any event infact) of excel am getting "No such
interface supported" error.
Here is the code
public void OnStartupComplete(ref System.Array custom)
{
..................................
Excel.Application objExlApp = (Excel.Application)applicationObject;
objExlApp .SheetBeforeRightClick += new
AppEvents_SheetBeforeRightClickEventHandler(this.ExlRightClick_EvtHandler);
.................................
}
public void ExlRightClick_EvtHandler(object Sh,Excel.Range Target,ref bool
Cancel)
{
MessageBox.Show("Inside right click event handler");
}
Though it compiles, am getting "No such interface supported" error during
the runtime at the statement objExlApp .SheetBeforeRightClick += new
AppEvents_SheetBeforeRightClickEventHandler(this.ExlRightClick_EvtHandler);
..

Please help.
 
Hi Karthikeyan,
Am developing an addin for Excel using C#. When i try to trap the
SheetBeforeRightClick event(any event infact) of excel am getting "No such
interface supported" error.

You're more likely to get a helpful response if you post your question in the
public.vsnet.vstools.office newsgroup.

Regards

Stephen Bullen
Microsoft MVP - Excel

Professional Excel Development
The most advanced Excel VBA book available
www.oaltd.co.uk/ProExcelDev
 
Back
Top