Partilhar via


WorkbookBase.PublishObjects Property

Gets the Microsoft.Office.Interop.Excel.PublishObjects collection.

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

Syntax

'Declaration
Public ReadOnly Property PublishObjects As PublishObjects
public PublishObjects PublishObjects { get; }

Property Value

Type: Microsoft.Office.Interop.Excel.PublishObjects
The Microsoft.Office.Interop.Excel.PublishObjects collection.

Examples

The following code example uses the PublishObjects property to publish all static Microsoft.Office.Interop.Excel.PublishObject items in the active workbook to the Web page.

This example is for a document-level customization.

Private Sub WorkbookPublishObjects()
    Dim i As Integer 
    For i = 1 To Me.PublishObjects.Count
        If Me.PublishObjects(i).HtmlType = _
            Excel.XlHtmlType.xlHtmlStatic Then 
            Me.PublishObjects(i).Publish()
        End If 
    Next i
End Sub
private void WorkbookPublishObjects()
{
    for (int i = 1; i <= this.PublishObjects.Count; i++)
    {
        if (this.PublishObjects[i].HtmlType ==
            Excel.XlHtmlType.xlHtmlStatic)
        {
            this.PublishObjects[i].Publish();
        }
    }
}

.NET Framework Security

See Also

Reference

WorkbookBase Class

Microsoft.Office.Tools.Excel Namespace