【问题标题】:Path not found error when trying to access sharepoint尝试访问共享点时找不到路径错误
【发布时间】:2013-07-10 04:43:15
【问题描述】:

我正在使用此代码使用 excel VBA 循环遍历 sharepoint 中的文件。当我使用本地驱动器路径时,此代码工作正常。但是当我用我的共享点路径替换路径时,我在 fs.GetFolder 收到一条错误消息“找不到路径”

请多多指教

我使用的代码是:

Private Sub CommandButton2_Click()

Dim folder As Variant
Dim f As File
Dim fs As New FileSystemObject
Dim fs1 As New OLEObject
Dim RowCtr As Integer
Dim FPath As String
Dim wb As Workbook
FPath = "my URL"
Set fs = CreateObject("Scripting.FileSystemObject")
RowCtr = 1
Set folder = fs.GetFolder(FPath)
'<=Variable Location
For Each f In folder.Files
   Cells(RowCtr, 1).Value = f.Name
   RowCtr = RowCtr + 1
Next f
End Sub

【问题讨论】:

  • 您使用的是 http 路径,还是 webdav 路径? http 不会工作...
  • 我尝试使用 http 路径示例路径:"path/more path/foldername" 我什至尝试将路径作为 "\\path\more path\foldername" 两者都不起作用
  • 如果您只有 http 访问权限,那么您不能使用文件系统对象循环访问这样的文件夹。也许有一个共享点的方式来做到这一点,但我不熟悉那个平台。

标签: vba sharepoint excel


【解决方案1】:

您需要将共享点映射到 Windows 驱动器号,如 SharePoint StackExchange 中所述。映射后,您将能够作为本地驱动器路径打开。

【讨论】:

    猜你喜欢
    • 2012-12-06
    • 2018-12-25
    • 1970-01-01
    • 1970-01-01
    • 2014-04-10
    • 1970-01-01
    • 1970-01-01
    • 2022-12-19
    • 1970-01-01
    相关资源
    最近更新 更多