Option Explicit Sub 打开文件夹() Dim pth pth = "d:\temp" If Dir(pth, vbDirectory) = vbNullString Then MsgBox pth: Exit Sub Shell "explorer.exe " & pth, vbNormalFocus End Sub
Option Explicit Sub 打开文件夹() Dim pth pth = CreateObject("Wscript.shell").SpecialFolders("desktop") & "\" & [a1].Value If Dir(pth, vbDirectory) = vbNullString Then MsgBox pth: Exit Sub Shell "explorer.exe " & pth, vbNormalFocus End Sub