azhar2006
Registered User.
- Local time
- Today, 13:25
- Joined
- Feb 8, 2012
- Messages
- 202
Good evening guys
I am trying to call section (C:\Program Files) of the computer through a button and display its contents only. I used this code that I found in the forum for the colleague (arnelgp) but it did not work.
I am trying to call section (C:\Program Files) of the computer through a button and display its contents only. I used this code that I found in the forum for the colleague (arnelgp) but it did not work.
Code:
Dim strPath As String
strPath = ""
If Len(strPath) Then
strPath = getPath(strPath)
Else
strPath = Environ$("C:\Program Files")
End If
Application.FollowHyperlink strPath
Public Function getPath(ByVal p As String)
Dim sPath As String
Dim i As Integer
i = InStrRev(p, "\")
sPath = Left$(p, i)
getPath = sPath
End Function