PublishObject.AutoRepublish property (Excel)

When a workbook is saved, Microsoft Excel determines if any item in the PublishObjects collection has the AutoRepublish property set to True, and if so, republishes it. The default value is False. Read/write Boolean.

Syntax

expression.AutoRepublish

expression A variable that represents a PublishObject object.

Example

This example publishes a range on a worksheet to an HTML file on the C:\ drive. When the user saves the workbook containing the worksheet, Excel will automatically republish the range to the same HTML file. This example assumes that the user has read/write access to the webpage and that cells A1 through D10 on the worksheet have values in them.

Sub PublishToWeb() 
 
 With ActiveWorkbook.PublishObjects.Add( _ 
 SourceType:= xlSourceRange, _ 
 Filename:="C:\Work.htm", _ 
 Sheet:="Sheet1", _ 
 Source:="A1:D10", _ 
 HtmlType:=xlHtmlStatic, _ 
 DivID:="Book1.xls_130489") 
 .Publish 
 .AutoRepublish = True 
 End With 
 
End Sub

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.