使用VBA在sharepoint文档库中创建文件夹

时间:2018-03-08 10:57:12

标签: excel-vba sharepoint-2010 vba excel

我正在尝试使用Excel VBA在sharepoint文档库中创建一个文件夹。这是我的代码无效

 Sub CreateFolder_SP()

 Dim strURL As String

''Copy and paste the URL of your sharePoint folder where you want to create another folder

  strURL = "http://sharepoint link/"

 'strURL = Replace(strURL, "http:", "") //// have also tried this

 strURL = Replace(Replace(strURL, "http:", ""), "/", "\")

Dim Fld_r As String

 Fld_r = "Test"
 Fld_r = Replace(Fld_r, Chr(9), " ")

 If Len(Dir(strURL & Fld_r, vbDirectory)) = 0 Then ''' I am getting run-time error here bad File name or number or sometimes path not found
  MkDir (strURL & Fld_r)
  DoEvents

 End If
 End sub

0 个答案:

没有答案