Add Method (PublishObjects Collection) 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