VBA MKDIR in SharePoint fails

天涯浪子 提交于 2019-12-31 01:54:22

问题


Here is my issue:

I am trying to make a folder in a SharePoint shared document library. But it only works after I enter my credentials using the "open with windows explorer" menu item.

My users will not understand if I tell them they need to do this first. So, my questions is either: (A) is there a way to force this credential popup from VBA OR... (B) is there a way to pass these credentials through VBA

myWorkbookBasePath= "\\sharepoint.buckeye.com\sites\transportation\cc\pipelineoperationreports\Shared%20Documents\" & folder


MkDir myWorkbookBasePath


回答1:


What credentials would you use if you could provide them programmatically? If you can answer that, you could try something like this:

Set objNetwork = CreateObject("WScript.Network")
objNetwork.MapNetworkDrive "Z:", "\\server\share", False, strUser, strPwd

MkDir "Z:\NewFolder"
...
objNetwork.RemoveNetworkDrive "Z:"


来源:https://stackoverflow.com/questions/31074253/vba-mkdir-in-sharepoint-fails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!