Excel publish multiple sheet using VBA -
i trying publish multiple sheets in excel using vba. need publish sheet 2 , 3.
below code.
with activeworkbook .weboptions.allowpng = false .publishobjects(2) range("a1").activate .filename = "d:\reports\09192014\mnm.html" .publish (true) end end
in publishobjects(2)
changing number 2 3 manually below.
with activeworkbook .weboptions.allowpng = false .publishobjects(3) range("a1").activate .filename = "d:\reports\09192014\coal.html" .publish (true) end end
still though, in html report coal.html
getting mnm.html
data , has half of data.
how can iterate sheets , publish objects?
shouldn't adding first this?:
activeworkbook.publishobjects.add(xlsourcesheet, _ "d:\reports\09192014\mnm.html", "sheet1", , _ xlhtmlstatic, , "") .publish (true) .autorepublish = false '~~> true updates html when workbook saved end activeworkbook.publishobjects.add(xlsourcesheet, _ "d:\reports\09192014\coal.html", "sheet2", , _ xlhtmlstatic, , "") .publish (true) .autorepublish = false end
after adding it, time can access using publishobjects collection
via index number.
index based on sequence object
created.
Comments
Post a Comment