PDA

View Full Version : [SOLVED] Is there a way to call up....



74Pumpkin
11-24-2004, 10:07 PM
Is there a way to double click on a cell with someones name in it and have a word document ( Or something like it) specific to that person pop up?

I have a schedule for 85 people that I would like to be able to keep track of personell type stuff. :confused:

Kieran
11-24-2004, 10:09 PM
74Pumpkin,

You could create a hyperlink to another document to do this.

Jacob Hilderbrand
11-25-2004, 01:23 AM
Put this in a module:


Option Explicit

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
ByVal hWnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long

Sub OpenAnyFile(FilePath As String, FileName As String)
Dim FileToOpen As String
FileToOpen = FilePath & "\" & FileName
Call ShellExecute(0, "Open", FileToOpen & vbNullString, vbNullString, vbNullString, 1)
End Sub

Then put this in the worksheet code module:


Option Explicit

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
Call OpenAnyFile(Path, Filename)
End Sub

Just supply the path and file name.

74Pumpkin
11-25-2004, 07:21 AM
Thanks guys that should work.