F
FatherGuido
Posted to Programming & Charting
Windows 2000 with Excel 2002
I have created an excel spreadsheet that has a sheet containg 12 charts.
I recorded a macro as I saved them to my web location, then ran thought
it manually. I discovered 2 of the 12 charts would fail (see actual
recorded macro below). Why? Each chart was originally copied from the
same chart and just had its source data changed. I tried changing the
order, and re-writing the code from other parts that worked -- but the
same two charts always failed. Again why, they are identical except for
the chart numbers.
Test macro exactly as recorded.
Sub Macro15()
'
' Macro15 Macro
' Macro recorded 8/14/03 by Norman Dillon
'
'
ActiveSheet.ChartObjects("Chart 9").Activate
ActiveChart.ChartArea.Select
With ActiveWorkbook.PublishObjects.Add(xlSourceChart, _
"D:\Profiles\ndillon\Desktop\Norm1.htm", "Web", "Chart 9",
xlHtmlStatic, _
"DOH_26509", "")
.Publish (True)
.AutoRepublish = False
End With
ActiveSheet.ChartObjects("Chart 9").Activate
ChDir "D:\Profiles\ndillon\Desktop"
ActiveWindow.Visible = False
Windows("DOH.xls").Activate
ActiveSheet.ChartObjects("Chart 30").Activate
ActiveChart.ChartArea.Select
With ActiveWorkbook.PublishObjects.Add(xlSourceChart, _
"D:\Profiles\ndillon\Desktop\Page2.htm", "Web", "Chart 30",
xlHtmlStatic, _
"DOH_27930", "")
.Publish (True)
.AutoRepublish = False
End With
ActiveSheet.ChartObjects("Chart 30").Activate
End Sub
Run-time error '1004';
Unable to get the ChartObjects property of the Worksheet Class
It always crashes on line 'ActiveSheet.ChartObjects("Chart
30").Activate'
The other chart also fails in the exact same location.
I really need to get this working ASAP if I want to go on vacation
Saturday. *L*
Any/all help greatly appreciated!!!
Thanks in advance.
Norm
Father Guido
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
I plan on living forever... so far, so good
Windows 2000 with Excel 2002
I have created an excel spreadsheet that has a sheet containg 12 charts.
I recorded a macro as I saved them to my web location, then ran thought
it manually. I discovered 2 of the 12 charts would fail (see actual
recorded macro below). Why? Each chart was originally copied from the
same chart and just had its source data changed. I tried changing the
order, and re-writing the code from other parts that worked -- but the
same two charts always failed. Again why, they are identical except for
the chart numbers.
Test macro exactly as recorded.
Sub Macro15()
'
' Macro15 Macro
' Macro recorded 8/14/03 by Norman Dillon
'
'
ActiveSheet.ChartObjects("Chart 9").Activate
ActiveChart.ChartArea.Select
With ActiveWorkbook.PublishObjects.Add(xlSourceChart, _
"D:\Profiles\ndillon\Desktop\Norm1.htm", "Web", "Chart 9",
xlHtmlStatic, _
"DOH_26509", "")
.Publish (True)
.AutoRepublish = False
End With
ActiveSheet.ChartObjects("Chart 9").Activate
ChDir "D:\Profiles\ndillon\Desktop"
ActiveWindow.Visible = False
Windows("DOH.xls").Activate
ActiveSheet.ChartObjects("Chart 30").Activate
ActiveChart.ChartArea.Select
With ActiveWorkbook.PublishObjects.Add(xlSourceChart, _
"D:\Profiles\ndillon\Desktop\Page2.htm", "Web", "Chart 30",
xlHtmlStatic, _
"DOH_27930", "")
.Publish (True)
.AutoRepublish = False
End With
ActiveSheet.ChartObjects("Chart 30").Activate
End Sub
Run-time error '1004';
Unable to get the ChartObjects property of the Worksheet Class
It always crashes on line 'ActiveSheet.ChartObjects("Chart
30").Activate'
The other chart also fails in the exact same location.
I really need to get this working ASAP if I want to go on vacation
Saturday. *L*
Any/all help greatly appreciated!!!
Thanks in advance.
Norm
Father Guido
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
I plan on living forever... so far, so good