Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I used this vba code in the code module in Excel 2002 (SP3) to publish chart1
created from data on sheet2, but am getting the object define error: Sub PublishToWeb() Set oPObjs = ActiveWorkbook.PublishObjects oPObjs.Add( _ SourceType:=xlSourceChart, _ Filename:="C:\Work.htm", _ Sheet:="Chart1", _ Source:="Chart1", _ HtmlType:=xlHtmlStatic, _ DivID:="Chart1.xls_04").Publish End Sub I tried to change the Source and Sheet arguments but it did not help. I used a similer sub for the sheets and it worked fine: Sub PublishToWeb() Set oPObjs = ActiveWorkbook.PublishObjects oPObjs.Add( _ SourceType:=xlSourceRange, _ Filename:="C:\Work.htm", _ Sheet:="Sheet2", _ Source:="A1:L2", _ HtmlType:=xlHtmlStatic, _ DivID:="Sheet1.xls_04").Publish End Sub What am I missing here? Thanks for the help. Martin. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I recast my statements to something like these and they are now working:
With ActiveWorkbook.PublishObjects.Add(SourceType:=xlSo urceChart, _ Filename:="C:\Work.htm", Sheet:="Chart1", Source:="Chart 1", _ HtmlType:=xlHtmlStatic, DivID:="Chart1_04") .Publish (True) End With "Martin N" wrote: I used this vba code in the code module in Excel 2002 (SP3) to publish chart1 created from data on sheet2, but am getting the object define error: Sub PublishToWeb() Set oPObjs = ActiveWorkbook.PublishObjects oPObjs.Add( _ SourceType:=xlSourceChart, _ Filename:="C:\Work.htm", _ Sheet:="Chart1", _ Source:="Chart1", _ HtmlType:=xlHtmlStatic, _ DivID:="Chart1.xls_04").Publish End Sub I tried to change the Source and Sheet arguments but it did not help. I used a similer sub for the sheets and it worked fine: Sub PublishToWeb() Set oPObjs = ActiveWorkbook.PublishObjects oPObjs.Add( _ SourceType:=xlSourceRange, _ Filename:="C:\Work.htm", _ Sheet:="Sheet2", _ Source:="A1:L2", _ HtmlType:=xlHtmlStatic, _ DivID:="Sheet1.xls_04").Publish End Sub What am I missing here? Thanks for the help. Martin. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2007 - publish chart as htm web page file | Charts and Charting in Excel | |||
publish chart to IIS Server | Charts and Charting in Excel | |||
Publish Excel Pivot Chart | Excel Programming | |||
Publish Macro | Excel Programming | |||
Publish Sheet AND Chart | Excel Programming |