【发布时间】:2025-12-17 08:55:01
【问题描述】:
使用 2010 Excel VBA - 我只是想通过子打开一个文件夹。我在这里做错了什么?
VBA
Sub openFolder()
Dim preFolder As String, theFolder As String, fullPath as String
theFolder = Left(Range("T12").Value, 8)
preFolder = Left(Range("T12").Value, 5) & "xxx"
fullPath = "P:\Engineering\031 Electronic Job Folders\" & preFolder & "\" & theFolder
Shell(theFolder, "P:\Engineering\031 Electronic Job Folders\" & preFolder, vbNormalFocus)
End Sub
【问题讨论】:
-
文件夹打开后你想做什么?
-
Shell 只接受两个参数。如前所述,不清楚您在做什么
-
我希望用户能够单击一个按钮并在屏幕上打开文件夹 - 没有别的。
标签: vba excel directory excel-2010