Add Method (PublishObjects Collection)

See Also         Example         Applies To

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.

Syntax

expression.Add(SourceType, Filename, Sheet, Source, HtmlType, DivID, Title)

expression   An expression that returns a PublishObjects object.

SourceType   Required XlSourceType. Identifies the source object. Can be one of the XlSourceType constants listed in the following table.

Constant Description
xlSourceAutoFilter An AutoFilter range
xlSourceChart A chart
xlSourcePivotTable A PivotTable report
xlSourcePrintArea A range of cells selected for printing
xlSourceQuery A query table (external data range)
xlSourceRange A range of cells
xlSourceSheet An entire worksheet

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

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

Source   Optional Variant. 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   Optional Variant. Specifies whether the item is saved as an interactive Microsoft Office Web component or as static text and images. Can be one of the XlHTMLType constants listed in the following table.

Constant Description
xlHTMLCalc A spreadsheet component
xlHTMLChart A chart component
xlHTMLList A PivotTable component
xlHTMLStatic Static (noninteractive) HTML

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

Title   Optional Variant. The title of the Web page.