Syntax

expression.Publish(Create)

expression A variable that represents a PublishObject object.

Parameters

Name Required/Optional Data Type Description
Create Optional Variant If the HTML file exists, setting this argument to True replaces the file, and setting this argument to False inserts the item or items at the end of the file. If the file does not exist, then the file is created regardless of the value of the Create argument.

Remarks

The property returns or sets the location and name of the HTML file.

Example

This example saves the range D5:D9 on the First Quarter worksheet in the active workbook to a Web page named stockreport.htm. The Spreadsheet component is used to make the Web page interactive.

Visual Basic for Applications
ActiveWorkbook.PublishObjects.Add( _ SourceType:=xlSourceRange, _ Filename:="\\Server2\Q1\stockreport.htm", _ Sheet:="First Quarter", _ Source:="D5:D9", _ HTMLType:=xlHTMLCalc).Publish

See also: