ListObject.SharePointURL Property

Gets the URL of the SharePoint list for a given ListObject control.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)

Syntax

'Declaration
ReadOnly Property SharePointURL As String
    Get
string SharePointURL { get; }

Property Value

Type: System.String
The URL of the SharePoint list for a given ListObject control.

Remarks

Accessing this property causes an exception to be thrown if the list is not linked to a SharePoint site.

Examples

The following code example publishes a ListObject to a Web site that is running Microsoft Windows SharePoint Services. This example assumes that there is a ListObject named customerListObject on the current worksheet, and that the ListObject is linked to a SharePoint site.

This example is for a document-level customization.

    Private Sub ListObject_SharePointURL()
        Dim TargetParam As String() = {customerListObject.SharePointURL, _
            "Customers", "Customer data"}
        customerListObject.Publish(TargetParam, False)
    End Sub

private void ListObject_SharePointURL()
{
    string[] TargetParam = { customerListObject.SharePointURL,
        "Customers", "Customer data" };
    customerListObject.Publish(TargetParam, false);
}

.NET Framework Security

See Also

Reference

ListObject Interface

Microsoft.Office.Tools.Excel Namespace