Share via


PublishObject.HtmlType Property

Excel Developer Reference

Returns or sets the type of HTML generated by Microsoft Excel when you save the specified item to a Web page. Can be one of the XlHtmlType constants listed in the following table, specifying whether the item is static or interactive in the Web page. The default value is xlHtmlStatic.

Syntax

expression.HtmlType

expression   A variable that represents a PublishObject object.

Remarks

XlHtmlType can be one of these XlHtmlType constants.
xlHtmlCalc. Use the Spreadsheet component.
xlHtmlChart. Use the Chart component.
xlHtmlList. Use the PivotTable component.
xlHtmlStatic. Use static (noninteractive) HTML for viewing only.

Example

This example saves the range D5:D9 on the First Quarter worksheet in the active workbook to a Web page called “stockreport.htm”.

Visual Basic for Applications
  With ActiveWorkbook.PublishObjects.Add(SourceType:=xlSourceRange, _
    Filename:="\\Server\stockreport.htm", Sheet:="First Quarter", Source:="$G$3:$H$6", _
    HtmlType:=xlHtmlStatic, DivID:="Book1_4170")
        .Publish (True)
        .AutoRepublish = False
End With

See Also