I tried but when I open it on 64 bit it still comes up with errors. and says something like "I need to add a ptrsafe attribute
this is full code..
'Code to open ANY files double clicking on cell or range of cells
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hWnd As LongPtr, ByVal lpOperation As String, ByVal lpFile As String, _
ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Const SW_SHOW As Long = 5&
'change path as required.
Sub OpenFile(strFilePath As String)
ShellExecute Application.hWnd, "Open", strFilePath, 0&, 0&, SW_SHOW
End Sub
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, cancel As Boolean)
If Not Intersect(Target, Range("BJ6")) Is Nothing Then
cancel = True
Sheets("Drawings").Select
ElseIf Not Intersect(Target, Range("AF6")) Is Nothing Then
cancel = True
Sheets("Finance").Select
ElseIf Not Intersect(Target, Range("AP6")) Is Nothing Then
cancel = True
Sheets("Design").Select
ElseIf Not Intersect(Target, Range("AZ6")) Is Nothing Then
cancel = True
Sheets("Materials").Select
ElseIf Not Intersect(Target, Range("BT6")) Is Nothing Then
cancel = True
Sheets("DFP").Select
ElseIf Not Intersect(Target, Range("CD6")) Is Nothing Then
cancel = True
Sheets("Delivery & Docs").Select
End If
End Sub
Bookmarks