在Sharepoint站点中发布Excel工作簿

我有一个Excel工作簿,我需要使用Excel VBA在SharePoint站点中发布它.所以我使用下面的代码在模块中创建了一个方法:

Private sc_Lists As SoapClient30

Public c_WSDL_URL As String

Private Const c_SERVICE As String = "Lists"

Private Const c_PORT As String = "ListsSoap"

Private Const c_SERVICE_NAMESPACE As String = "http://schemas.microsoft.com/sharepoint/soap/"


Private Sub Class_Initialize()

    Dim str_WSML As String
    str_WSML = ""
    Set sc_Lists = New SoapClient30
    c_WSDL_URL = glb_URL

    sc_Lists.MSSoapInit2 c_WSDL_URL, str_WSML, c_SERVICE, c_PORT, c_SERVICE_NAMESPACE

    sc_Lists.ConnectorProperty("WinHTTPAuthScheme") = &H1
    sc_Lists.ConnectorProperty("UseSSL") = True
    sc_Lists.ConnectorProperty("AuthUser") = "username"
    sc_Lists.ConnectorProperty("AuthPassword") = "pass"

End Sub 

问题是当我打开excel文档并尝试发布它然后它要求我的SharePoint站点的凭据,即使我已经在代码中提供了它们,如上所示.我需要的是防止在发布时询问凭据.

最佳答案 尝试使用VBA推送到SP时,我遇到了auth问题;它只是脆弱和挑剔.我在工作中使用的一个解决方案是将SP站点映射为网络驱动器,然后直接将文件保存为
(like in this UC tutorial),从而避免了这个问题.

点赞