hello
I need updating the code to make more dynamically by open all extensions files (pdf,docx,jpg,png,xls....) when press open any file for any cell in column (D)
should opene it .
thanks
I need updating the code to make more dynamically by open all extensions files (pdf,docx,jpg,png,xls....) when press open any file for any cell in column (D)
should opene it .
VBA Code:
Sub OPENFILE(c As Range)
Dim strname As String
Application.EnableEvents = False
strname= ActiveWorkbook.Path & "\" & c.Value & ".xlsm"
c(1, 4).Hyperlinks.Delete
If c = "" Then
c(1, 4) = ""
Else
If Dir(stPath) <> "" Then
c(1, 4).Hyperlinks.Add c(1, 4), stPath, , , "open file"
Else
c(1, 4) = "the file is not available
End If
End If
Application.EnableEvents = True
End Sub