Excel addin from C# - Trap excel events

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.
 
S

Stephen Bullen

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top