Hi
I copy codes from this site. It works in environment of office 2000. After installed office 2003, I changed these 2 chart object to new id in office 2003. However. it does not work for Spreadsheet1 classid=CLSID:0002E559-0000-0000-C000-000000000046
After checking. problem is in this line
oSheet.Range("B1:B10").Value = Array("OBC", 20,37, 200,40,18,57,120,167,145)
It can not get value. it appears OBC in all of cell.
some wrong?
Any ideal?
FairfaxVB
***********source codes
<%@ Language=VBScript %>
<HTML>
<head><title>chart example</title></head>
<STRONG><CENTER> Calls Per Day </CENTER></STRONG>
<BODY>
<object id=ChartSpace1 classid=CLSID:0002E55D-0000-0000-C000-000000000046 style="width:100%;height:480"></object>
<object id=Spreadsheet1 classid=CLSID:0002E559-0000-0000-C000-000000000046 style="width:100%;height:480"></object>
<script language=vbs>
Sub Window_OnLoad()
Dim oSheet
Set oSheet = Spreadsheet1.ActiveSheet
oSheet.Cells.Clear
oSheet.Range("A2:A10").Value = Array("06/06/2005","06/07/2005","06/08/2005","06/09/2005","06/10/2005","06/11/2005","06/12/2005","06/13/2005","06/14/2005")
oSheet.Range("B1:B10").Value = Array("OBC", 20,37, 200,40,18,57,120,167,145)
Dim oChart
ChartSpace1.Clear
Set oChart = ChartSpace1.Charts.Add
ChartSpace1.DataSource = Spreadsheet1
dim c
set c = ChartSpace1.Constants
dim oSeries
for i=1 to 1
Set oSeries = oChart.SeriesCollection.Add
oSeries.SetData c.chDimValues, 0, oSheet.Range(oSheet.Cells(2,2), oSheet.Cells(10,2)).Address
oSeries.SetData c.chDimSeriesNames, 0, oSheet.Cells(1,1).Address
next
oChart.SetData c.chDimCategories, 0, "a2:a10"
oChart.Axes(c.chAxisPositionLeft).NumberFormat = "0.0"
oChart.Axes(c.chAxisPositionLeft).MajorUnit = 50
End Sub
</script>
</BODY>
</HTML>
I copy codes from this site. It works in environment of office 2000. After installed office 2003, I changed these 2 chart object to new id in office 2003. However. it does not work for Spreadsheet1 classid=CLSID:0002E559-0000-0000-C000-000000000046
After checking. problem is in this line
oSheet.Range("B1:B10").Value = Array("OBC", 20,37, 200,40,18,57,120,167,145)
It can not get value. it appears OBC in all of cell.
some wrong?
Any ideal?
FairfaxVB
***********source codes
<%@ Language=VBScript %>
<HTML>
<head><title>chart example</title></head>
<STRONG><CENTER> Calls Per Day </CENTER></STRONG>
<BODY>
<object id=ChartSpace1 classid=CLSID:0002E55D-0000-0000-C000-000000000046 style="width:100%;height:480"></object>
<object id=Spreadsheet1 classid=CLSID:0002E559-0000-0000-C000-000000000046 style="width:100%;height:480"></object>
<script language=vbs>
Sub Window_OnLoad()
Dim oSheet
Set oSheet = Spreadsheet1.ActiveSheet
oSheet.Cells.Clear
oSheet.Range("A2:A10").Value = Array("06/06/2005","06/07/2005","06/08/2005","06/09/2005","06/10/2005","06/11/2005","06/12/2005","06/13/2005","06/14/2005")
oSheet.Range("B1:B10").Value = Array("OBC", 20,37, 200,40,18,57,120,167,145)
Dim oChart
ChartSpace1.Clear
Set oChart = ChartSpace1.Charts.Add
ChartSpace1.DataSource = Spreadsheet1
dim c
set c = ChartSpace1.Constants
dim oSeries
for i=1 to 1
Set oSeries = oChart.SeriesCollection.Add
oSeries.SetData c.chDimValues, 0, oSheet.Range(oSheet.Cells(2,2), oSheet.Cells(10,2)).Address
oSeries.SetData c.chDimSeriesNames, 0, oSheet.Cells(1,1).Address
next
oChart.SetData c.chDimCategories, 0, "a2:a10"
oChart.Axes(c.chAxisPositionLeft).NumberFormat = "0.0"
oChart.Axes(c.chAxisPositionLeft).MajorUnit = 50
End Sub
</script>
</BODY>
</HTML>