Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
一个驱动器工作时,Excel VBA在sharepoint中创建文件夹失败_Excel_Vba - Fatal编程技术网

一个驱动器工作时,Excel VBA在sharepoint中创建文件夹失败

一个驱动器工作时,Excel VBA在sharepoint中创建文件夹失败,excel,vba,Excel,Vba,我在Excel中有以下代码 Set fObj = CreateObject("Scripting.FileSystemObject") If fObj.FolderExists(Path & "\" & Left(Duration, 2)) Then Else fObj.CreateFolder (Path & "\" & Left(Duration, 2)) 这对于本地系统上的文件夹以及一个驱动器文件

我在Excel中有以下代码

Set fObj = CreateObject("Scripting.FileSystemObject")
If fObj.FolderExists(Path & "\" & Left(Duration, 2)) Then
Else
fObj.CreateFolder (Path & "\" & Left(Duration, 2))

这对于本地系统上的文件夹以及一个驱动器文件夹(在本地系统上)都可以正常工作。但对于sharepoint站点路径,它将失败,并在需要在sharepoint中创建文件夹的行上显示错误错误文件消息。sharepoint路径是一个网址。我已尝试用空格替换%20,但无效。提前感谢您的帮助。

如果您可以连接到类似的网络,请尝试使用SharePoint文件夹的类似网络文件夹路径(而不是web URL)。