Name

publishobjects.Add(SourceType, Filename, [Sheet], [Source], [HtmlType], [DivID], [Title])

Synopsis

Creates an object that can be published from the workbook as a web page.

Argument

Settings

SourceType

An XlSourceType constant identifying the type of object to publish. Can be one of these settings:

xlSourceAutoFilter
xlSourceChart
xlSourcePivotTable
xlSourcePrintArea
xlSourceQuery
xlSourceRange
xlSourceSheet
xlSourceWorkbook

Filename

The full URL of the web page to create.

Sheet

If SourceType is xlSourceSheet or xlSourcePrintArea, this is the name of the worksheet to publish.

Source

If SourceType is xlSourceAutofilter or xlSourceRange, this argument is the address of the range, or the name of the range to publish entered as a string. If SourceType is xlSourceChart, xlSourcePivotTable, or xlSourceQuery, this argument is the name of the chart, pivot table, or query to publish.

HtmlType

An XlHTMLType constant identifying whether the published object is interactive. Can be one of these settings:

 xlHtmlCalc (interactive range)
 xlHtmlChart (interactive chart)
 xlHtmlList (interactive list)
 xlHtmlStatic (noninteractive)

DivID

The ID attribute of a <DIV> element in the target web page to replace. This argument allows you to replace part of a web page with the published item.

Title

A title to include in the <Title> element on the web page.

The arguments used by Add are complicated and their meanings vary based on the published source and target. It is easiest ...

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.