Skip to content

Latest commit

 

History

History
57 lines (36 loc) · 1.56 KB

Excel.ListObject.SharePointURL.md

File metadata and controls

57 lines (36 loc) · 1.56 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
ListObject.SharePointURL property (Excel)
vbaxl10.chm734095
vbaxl10.chm734095
Excel.ListObject.SharePointURL
a5b19612-c8e8-4952-e15c-a60da10f65d1
04/30/2019
medium

ListObject.SharePointURL property (Excel)

Returns a String representing the URL of the SharePoint list for a given ListObject object. Read-only String.

Syntax

expression.SharePointURL

expression A variable that represents a ListObject object.

Remarks

Accessing this property generates a run-time error if the list is not linked to a SharePoint site.

Example

The following example sets elements of the Target parameter of the Publish method to push the ListObject object to a SharePoint site. The code sample uses the SharePointURL property to assign the URL to the array and the Name property to assign the name of the list. The information in the array is then passed to the SharePoint site by using the Publish method.

Sub PublishList() 
 Dim wrksht As Worksheet 
 Dim objListObj As ListObject 
 Dim arTarget(4) As String 
 Dim strSTSConnection As String 
 
 Set wrksht = ActiveWorkbook.Worksheets("Sheet1") 
 Set objListObj = wrksht.ListObjects(1) 
 
 arTarget(0) = "0" 
 arTarget(1) = objListObj.SharePointURL 
 arTarget(2) = "1" 
 arTarget(3) = objListObj.Name 
 
 strSTSConnection = objListObj.Publish(arTarget, True) 
End Sub

[!includeSupport and feedback]