M
Martin N
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.
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.