LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Cannot seem to Cancel EXCEL App Right Click Event using C#

I am trying to use Excel from C# and need to disable the menu that appears when clicking the right mouse button on a cell.

I am trying to do this using the Excel.AppEvents_SheetBeforeRightClickEventHandler from my C# WinForm application.

I have a MessageBox that pops up that proves my event handler actually fires via my delegate but after setting the "Cancel" variable to "true" it has no effect for me. The Excel RMB menu appears when it should not. The Cancel parameter is declared as "ref bool".

I am wondering if there is a problem with the marshalling of this variable in the Office PIA which I am using. I would be happy to send code that demos my problem. Can someone please let me know if they can make it work ?

By the way I have already written some VB6 code that works fine and VBA code in an Excel Workbook that also works just fine as well. Both disable the menu as I require when I set "Cancel" to "True". The problem is that I need to do this from a C# application.

Can anyone shed some light on this at all ?

I am using...

Microsoft Excel 2002 (10.4302.4219) SP-2
Visual Studio 2003 v7.1.3088
Microsoft .NET Framework 1.1 v1.1.4322

I obtained the Office XP Primary Interop Assemblies from the following link

http://www.microsoft.com/downloads/d...displaylang=en


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cancel sheet change event NSK Charts and Charting in Excel 1 July 17th 07 08:25 PM
On Click Event?, and how to use Wandering Mage Excel Programming 5 June 7th 04 04:28 PM
Cancel terminate event?? Pop Excel Programming 1 May 19th 04 12:00 PM
Before Right Click event mohsinb[_8_] Excel Programming 10 December 22nd 03 08:47 AM
Click Event Nichevo Excel Programming 2 December 4th 03 04:31 AM


All times are GMT +1. The time now is 06:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"