View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Ji Zhou [MSFT] Ji Zhou [MSFT] is offline
external usenet poster
 
Posts: 3
Default VSTO BeforeDoubleClick edit mode

Hello Ed White,

Thanks for using Microsoft Newsgroup Support Service, my name is Ji Zhou
[MSFT] and I will be working on this issue with you.

First, I want to ensure I understand the issue correctly. From the
description, it is a VSTO Excel project. The objective is calling VSTO
codes, but does not make the Excel enter into edit mode, when end user
double clicks a cell in the Excel sheet. If I misunderstood your issue,
please feel free to let me know.

If I have understood, then I think we can subscribe this.Application.
SheetBeforeDoubleClick event and, put our codes in the event handle
function. The event handle function has a parameter declared as "ref bool
Cancel". After we set the "Cancel" parameter to true, the default behavior
of Excel will be canceled. That is to say, double clicking will not make
the cell enter into edit mode.

I tested the following codes on my side, and it worked. If you have any
future questions or concerns, please feel free to let me know.
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
this.Application.SheetBeforeDoubleClick += new
Microsoft.Office.Interop.Excel.AppEvents_SheetBefo reDoubleClickEventHandler(
Application_SheetBeforeDoubleClick);
}

void Application_SheetBeforeDoubleClick(object Sh,
Microsoft.Office.Interop.Excel.Range Target, ref bool Cancel)
{
Cancel = true;
MessageBox.Show("Double click");
}


Best regards,
Ji Zhou , remove ‘online.’)
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.