Hi Folks
I'm trying to add some code to an Excel workbook to publsih workseets as
webpages. I know this is possible using the autorepublish when the workbook
is saved but I want to republsih these items on demand.
The code I'm using is:
---------
Dim myInt, I as Integer
Set objPOjs = ActiveWorkbook.PublishObjects
myInt = objPOjs.Count
For I= t to myInt
ActiveWorkbook.PublishObjects.Item(I).Publish
Next I
-----------
I've also tried
---------
Set obj = ActiveWorkbook.PublishObjects
For each objPO in objPObjs
If objPo.HtmlType = xlHTMLStatic Then
objPO.Publish
End If
Next objPO
--------
I get no complaint when there are no objects to publish but as soon as I
select areas and publish them as webpages then run the code it crashes saying:
Run-time error '1004':
Method 'Publish' of object 'PublishObject' failed
Any ideas?
Thanks
Andy
Bookmarks