Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default PublishoOjects error '1004' trying to publish web page through cod

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
publish as web page Hostohio Excel Discussion (Misc queries) 0 January 12th 10 06:47 PM
Publish Excel to a web page rich0336 Excel Discussion (Misc queries) 0 July 16th 08 06:59 PM
Publish as Wed Page JDH Setting up and Configuration of Excel 0 April 1st 08 03:21 PM
publish excel as web page Lakshmi Narayanan Excel Programming 0 February 24th 04 06:44 AM
Error 1004 - unable to set the orientation of the page setup class E Sullivan Excel Programming 4 October 27th 03 02:31 PM


All times are GMT +1. The time now is 08:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"