Including GridBand Tool
Posted: Mon Sep 27, 2010 3:33 pm
I'm trying to add the GridBand Tool to a VBScript, but the docs show examples for visual basic. Here's the code I have:
HTML (object within a table cell):
within VBScript tag
When I run this code, I get an access violation by IE 8.0.7600 and crashes the browser with message "Access violation at address 504F6CB8 in module 'teechart7.ocx'. Read of address 0000015A". Which seems to come from the ".Axis = TChart1.Axis.Left" line. Omitting that gives "Unexpected call to method or property access.".
I suspect that I haven't added the GridBand properly to the chart. Does anyone know how to add a the GridBand tool to a chart within VBScript? or any tool for that matter?
Thanks in advance!
HTML (object within a table cell):
Code: Select all
<object id="TChart1" CODEBASE="/chart/teechart7.cab#Version=7,0,0,0" TYPE="application/x-oleobject" width="100%" height="100%" classid="CLSID:FAB9B41C-87D6-474D-AB7E-F07D78F2422E" ></object>
Code: Select all
Sub Window_onload()
With TChart1
.AddSeries scBar
.Series(0).FillSampleValues 6
.Tools.Add tcGridBand
With .Tools.Items(0).asGridBand
.Axis = TChart1.Axis.Left
.Band1.Color = 16250354
.Band2.Color = 16116201
End With
End With
End Sub
I suspect that I haven't added the GridBand properly to the chart. Does anyone know how to add a the GridBand tool to a chart within VBScript? or any tool for that matter?
Thanks in advance!