HtmlType Property

Microsoft Excel Visual Basic

HtmlType Property

       

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.  Read/write XlHtmlType.

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.

expression.HtmlType

expression   Required. An expression that returns one of the objects in the Applies To list.

Example

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

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