Share via


PublishObjects.Add Method

Creates an object that represents an item in a document saved to a Web page. Such objects facilitate subsequent updates to the Web page while automated changes are being made to the document in Microsoft Excel. Returns a PublishObject object.

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

Syntax

'Declaration
Function Add ( _
    SourceType As XlSourceType, _
    Filename As String, _
    Sheet As Object, _
    Source As Object, _
    HtmlType As Object, _
    DivID As Object, _
    Title As Object _
) As PublishObject
'Usage
Dim instance As PublishObjects
Dim SourceType As XlSourceType
Dim Filename As String
Dim Sheet As Object
Dim Source As Object
Dim HtmlType As Object
Dim DivID As Object
Dim Title As Object
Dim returnValue As PublishObject

returnValue = instance.Add(SourceType, _
    Filename, Sheet, Source, HtmlType, _
    DivID, Title)
PublishObject Add(
    XlSourceType SourceType,
    string Filename,
    Object Sheet,
    Object Source,
    Object HtmlType,
    Object DivID,
    Object Title
)

Parameters

  • Filename
    Type: System.String

    Required String. The URL (on the intranet or the Web) or path (local or network) to which the source object was saved.

  • Sheet
    Type: System.Object

    Optional Object. The name of the worksheet that was saved as a Web page.

  • Source
    Type: System.Object

    Optional Object. A unique name used to identify items that have one of the following constants as their SourceType argument: xlSourceAutoFilter, xlSourceChart, xlSourcePivotTable, xlSourcePrintArea, xlSourceQuery, or xlSourceRange. If SourceType is xlSourceRange, Source specifies a range, which can be a defined name. If SourceType is xlSourceChart, xlSourcePivotTable, or xlSourceQuery, Source specifies the name of a chart, PivotTable report, or query table.

  • HtmlType
    Type: System.Object

    Optional Object. Specifies whether the item is saved as an interactive Microsoft Office Web component or as static text and images. Can be one of the following XlHtmlType constants.

    Constant

    Description

    xlHtmlCalc

    Item saved as an interactive Microsoft Office Spreadsheet component.

    xlHtmlChart

    Item saved as an interactive Microsoft Office Chart component.

    xlHtmlList

    Item saved as an interactive Microsoft Office PivotTable component.

    xlHtmlStatic

    Item saved as static text and images.

  • DivID
    Type: System.Object

    Optional Object. The unique identifier used in the HTML DIV tag to identify the item on the Web page.

  • Title
    Type: System.Object

    Optional Object. The title of the Web page.

Return Value

Type: Microsoft.Office.Interop.Excel.PublishObject

See Also

Reference

PublishObjects Interface

PublishObjects Members

Microsoft.Office.Interop.Excel Namespace