Application.DoubleClick

Jaafar Tribak

Well-known Member
Joined
Dec 5, 2002
Messages
9,616
Office Version
  1. 2016
Platform
  1. Windows
How to make Application.DoubleClick work for worsheet cells ?

It works for embeeded objects as well as for chart sheets but doesn't seem to carry the doubleclick action on cells as expected.

Any ideas ?

Regards.
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Hi Jaafar,

What embedded object? I couldn't get it to work with a cell, a chartobject, or a rectangle. This is with 2007.

In a standard module I had
Code:
Option Explicit

Dim myAppClass As Class1

Sub doDCtest()
    If myAppClass Is Nothing Then Set myAppClass = New Class1
    Application.DoubleClick
    End Sub
and in the class module Class1 I had
Code:
Option Explicit

Dim WithEvents myApp As Application

Private Sub Class_Initialize()
    Set myApp = Excel.Application
    End Sub

Private Sub myApp_NewWorkbook(ByVal Wb As Workbook)
    MsgBox "New WB " & Wb.Name
    End Sub

Private Sub myApp_SheetBeforeDoubleClick( _
        ByVal Sh As Object, _
        ByVal Target As Range, Cancel As Boolean)
    If TypeOf Target Is Range Then
        MsgBox Sh.Name & ", " & Target.Address
    Else
        MsgBox Sh.Name & ", " & TypeName(Target) & ", " & Target.Name
        End If
    End Sub
With a cell selected, a UI double-click triggers the beforeDC code and then allows editing of the cell. Neither happens with the application.doubleclick method. And, with an object selected nothing happens at all (since 2007 doesn't include double-click as a way to edit an object).

How to make Application.DoubleClick work for worsheet cells ?

It works for embeeded objects as well as for chart sheets but doesn't seem to carry the doubleclick action on cells as expected.

Any ideas ?

Regards.
 
Upvote 0
Thanks Tushar.

I works for objects selected in excel 2003. I don't have excel 2007 .

I have no idea why the Application has this Method if it does'nt work !

Regards.
 
Upvote 0

Forum statistics

Threads
1,214,924
Messages
6,122,294
Members
449,077
Latest member
Rkmenon

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