VB中打开文件夹

输入路径点击后打开文件夹,当我输入文件夹下Excel的地址时候可以打开Excel,问问高手代码怎么写

Private Function OpenPath(strPath As String) As Long
strPath = Chr(34) & Chr(34) & " " & Chr(34) & strPath & Chr(34)
OpenPath = Shell("cmd.exe /c Start " & strPath, vbHide)
End Function
上面是我写的一个函数,会用吧?

打开路径:OpenPath "C:\Program Files"
打开文件:OpenPath "D:\123\Excel.xls"
温馨提示:答案为网友推荐,仅供参考
相似回答