Work around for MsChart 6.1.89.12 and 6.1.89.13 bug
Posted
Fri, Jan 23 2009 13:06
by
bill
Last month (December 2008), Microsoft released some security updates for VB6 components such as the MS Chart control
The first update http://support.microsoft.com/kb/932349 updates MS Chart to 6.1.98.12.
The second update http://support.microsoft.com/kb/957924 updates MSChart to 6.1.98.13.
Both these versions have a serious bug that will crash the application or cause instability, the chart not to draw or display garbage strings on the screen.
The problem occurs if you display a DataPointLabel, eg:
Dim dpl As DataPointLabel
Set dpl = MSChart1.Plot.SeriesCollection.Item(1).DataPoints.Item(-1).DataPointLabel
dpl.LocationType = VtChLabelLocationTypeAbovePoint
dpl.ValueFormat = "0.00"
To work around this, add a manifest to your VB6 application, and copy the manifest and an earlier version of MSChart alongside your exe. The manifest contents needed are:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity name="Project1" version="1.0.0.0"
processorArchitecture="X86" type="win32" />
<file name="mschrt20.ocx">
<comClass clsid="{3A2B370C-BA0A-11D1-B137-0000F8753F5D}"
tlbid="{65E121D4-0C60-11D2-A9FC-0000F8754DA1}"
progid="MSChart20Lib.MSChart.2"
description="Microsoft Chart Control 6.0 (OLEDB)" />
</file>
</assembly>
Save that with a .manifest extension, e.g. Project1.exe.manifest. Make sure you replace the name and version attributes in the assemblyIdentity node with your application’s name and version.
Hopefully there will be a fix to fix the fix soon, but in the meanwhile use side-by-side (SxS) COM and an old version of the mschrt20.ocx to work around this new bug.