Hi everyone.
I need to publish objects from various pages in a workbook.
The range will always be A1:J40, but the sheet will change. "K3" will always have the filename on each sheet for publishing.
The above only works on the first sheet published.
How do I define the "PublishObjects(1)" using the sheet number as the (1)? Any help would be appreciated.
Or can I redefine the sheet associated with PublishObjects(1) each time the code is run?
I need to publish objects from various pages in a workbook.
The range will always be A1:J40, but the sheet will change. "K3" will always have the filename on each sheet for publishing.
Code:
With ActiveWorkbook
With .WebOptions
.RelyOnVML = True
.PixelsPerInch = 96
End With
With .PublishObjects(1)
'HDLocationName = RRange("K3").Value
.HtmlType = xlHtmlStatic
.FileName = HDLocationName
.Publish (True)
End With
End With
The above only works on the first sheet published.
How do I define the "PublishObjects(1)" using the sheet number as the (1)? Any help would be appreciated.
Or can I redefine the sheet associated with PublishObjects(1) each time the code is run?
Last edited: