ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Over ride double-click handler? (https://www.excelbanter.com/excel-programming/280733-over-ride-double-click-handler.html)

SW[_3_]

Over ride double-click handler?
 
Hi,

Is there a way to over-ride the default "double-click" method, using VB
code?

What I'd like to do is for an image editing application to launch when a use
double-clicks on a cell, and for that image editing application to open the
file-path reference contained within that particular cell.

For a variety of reasons, I don't want to record a macro and attach it to a
button.

Any help would be most appreciated.










Tom Ogilvy

Over ride double-click handler?
 
Use the beforedoubleclick event (right click on the sheet tab, select view
code, in the left dropdown of the module select workbook and in the right,
select beforedoubleclick)

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Excel.Range, Cancel
As Boolean)

If target.Address = "$C$5" then
cancel = true
shell "C:\Windows\ImageApp.exe " & target.value
End if
End Sub

Action would be taken for cell C5, Change to match you situation.

--
Regards,
Tom Ogilvy

SW wrote in message
...
Hi,

Is there a way to over-ride the default "double-click" method, using VB
code?

What I'd like to do is for an image editing application to launch when a

use
double-clicks on a cell, and for that image editing application to open

the
file-path reference contained within that particular cell.

For a variety of reasons, I don't want to record a macro and attach it to

a
button.

Any help would be most appreciated.













All times are GMT +1. The time now is 11:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com