我正在尝试使用 Application.PathSeparator 属性。但是 PathSeparator 属性不可用于选择,如果我在我的 VBA 代码中输入它,我会收到运行时错误 438 - 对象不支持此属性或方法。
我需要安装什么东西才能访问 PathSeparator 吗?我有 MS Office 2007 和 Outlook 2010。我没有安装 .Net 客户端。
尝试在下面的示例代码中使用:
Sub UnZipFile(strTargetPath As String, Fname As String)
Dim oApp As Object
Dim FileNameFolder As Variant
If Right(strTargetPath, 1) <> Application.PathSeparator Then
strTargetPath = strTargetPath & Application.PathSeparator
End If
FileNameFolder = strTargetPath
Set oApp = CreateObject("Shell.Application")
oApp.Namespace(FileNameFolder).CopyHere oApp.Namespace(strTargetPath & Fname).items
DoEvents
End Sub