作者:爬树小羊_298 | 来源:互联网 | 2023-05-19 12:24
IhaveanexcelworkbookandIneedtopublishitinaSharePointsiteusingExcelVBA.SoIcreated
I have an excel workbook and I need to publish it in a SharePoint site using Excel VBA. So I created a method in a module using the below code:
我有一个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
The problem is when I open the excel document and try to publish it then it asks for the credentials of my SharePoint site even though I have provided them in the code as can be seen above. What I need is to prevent asking credentials when publishing.
问题是,当我打开excel文档并尝试发布它然后它要求我的SharePoint站点的凭据,即使我已经在代码中提供了它们,如上所示。我需要的是防止在发布时询问凭据。
1 个解决方案