Hello, how can i open a specific folder using a single click on a button?
For example: i want to open this path: U:\A. Sampl1\B. Sample2
Hello, how can i open a specific folder using a single click on a button?
For example: i want to open this path: U:\A. Sampl1\B. Sample2
hi,
Check this (paste it into standard module)
![]()
Option Explicit Sub Open_Explorer() Dim stFolder As String stFolder = "c:\Temp" If Len(Dir(stFolder, vbDirectory)) <> 0 Then Shell "Explorer.exe /n,/e," & stFolder, vbNormalFocus Else MsgBox "The directory does not exist!", vbCritical End If End Sub
Best Regards
MaczaQ
---------------------------------------------------------------------------------------------------------------------------
If you are satisfied with the solution(s) provided, please mark your thread as Solved
If you are pleased with my answer consider to rate it. To thank someone who has helped you, click on the star icon below their name.
- This way you will add him some reputation points ... thanks in advance.
Maybe:
![]()
Sub siobeh() Dim Yourfolder As String Yourfolder = "U:\A Sample1\B Sample2\" ActiveWorkbook.FollowHyperlink Yourfolder, NewWindow:=True End Sub
Good way JOHN H. DAVIS but for me there is one little problem - everytime code is running user will have to accept security window because Hiperlinks are not safe in Excel meaning![]()
You're right MaczaQ. Could not figure a way around. Looks like your solution is better because it avoids that.
It works! Thanks MaczaQ and John! Perfect!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks