Worksheet_BeforeRightClick not firing in a Windows 8 Tablet...

cgutierrez

New Member
Joined
Sep 11, 2013
Messages
2
I am developing an excel vba application that uses the Worksheet_BeforeRightClick event to pop-up a dialog with a listbox in which the user can select from a list of products.

My event handler works perfectly in Excel for Microsoft Office 2013 and 2010... in Windows 8 and Windows 7 desktops...

However, it is not being called from a Windows 8 Tablet. If I use the mouse or trackpad to right-click on the sensitive cell, it works, but if I press my finger against the cell on the screen for several seconds, the context-sensitive menu comes up without my event-handler being called.

(Pressing the finger against the screen for a second or more is the tablet-way to simulate a right-click.)

Excel is recognizing the event because the context-sensitive menu for the cell comes up... the problem is my event-handler is not getting called.

Is this a bug in Excel/2013/Windows 8? Is there a separate vba event for touch gestures? Am I missing something?

I include the code for my event handler for completeness but the event is simply not getting dispatched:

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Dim rngSku, rngCust As Range

If kiHeaderRow0 = 0 Then ' Should never be zero...
Worksheet_Activate
End If

Set rngCust = Sheets("Orden").Range("B" + Format(kiHeaderRow0))
Set rngSku = Sheets("Orden").Range("C" + Format(kiDetailRow0) + ":C" + Format(kiDetailRow1))

Cancel = False

If Not Intersect(Target, rngSku) Is Nothing Then
DoSelSKU
Cancel = True
End If
If Not Intersect(Target, rngCust) Is Nothing Then
DoSelCust
Cancel = True
End If
End Sub
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
I have the same problem on a Windows 7 machine running Excel 2010. Did you find a solution?

I am developing an excel vba application that uses the Worksheet_BeforeRightClick event to pop-up a dialog with a listbox in which the user can select from a list of products.

My event handler works perfectly in Excel for Microsoft Office 2013 and 2010... in Windows 8 and Windows 7 desktops...

However, it is not being called from a Windows 8 Tablet. If I use the mouse or trackpad to right-click on the sensitive cell, it works, but if I press my finger against the cell on the screen for several seconds, the context-sensitive menu comes up without my event-handler being called.

(Pressing the finger against the screen for a second or more is the tablet-way to simulate a right-click.)

Excel is recognizing the event because the context-sensitive menu for the cell comes up... the problem is my event-handler is not getting called.

Is this a bug in Excel/2013/Windows 8? Is there a separate vba event for touch gestures? Am I missing something?

I include the code for my event handler for completeness but the event is simply not getting dispatched:

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Dim rngSku, rngCust As Range

If kiHeaderRow0 = 0 Then ' Should never be zero...
Worksheet_Activate
End If

Set rngCust = Sheets("Orden").Range("B" + Format(kiHeaderRow0))
Set rngSku = Sheets("Orden").Range("C" + Format(kiDetailRow0) + ":C" + Format(kiDetailRow1))

Cancel = False

If Not Intersect(Target, rngSku) Is Nothing Then
DoSelSKU
Cancel = True
End If
If Not Intersect(Target, rngCust) Is Nothing Then
DoSelCust
Cancel = True
End If
End Sub
 
Upvote 0
I apologize for the delay in replying... No, I never found an answer to this and never really used the app as we needed it to be used from a tablet exclusively.

I have not checked to see if newer updates to Excel 2013 fix this... I no longer have a windows tablet with Excel installed.
 
Upvote 0

Forum statistics

Threads
1,216,381
Messages
6,130,294
Members
449,570
Latest member
TomMacca52

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top