We graph data from data files in a Visual Basic 6 app by creating an Excel application object and having it generate the 2-D
line chart. This application was developed about 6 years ago and the engineer who originally wrote it is long gone, so I
have inherited it.
It has worked fine until we tried to use it on Excel 2007. We go with a lot of the default
chart settings. When it was written, Excel 97 and Excel 2000 were current and it still works fine with Excel 2003. But now
with Excel 2007, some of the default settings seem to have changed. For example, the chart title's default color has changed
from black to white. I've solved that problem by explicitly setting the color to black, thus overriding the new default.
It's the other change that I can't get a handle on. The plot line itself used to be thin and black, but now it's
thicker and blue. Blue isn't so much a problem, but we want to make it thin again so as to not hide the details.
The Visual Studio 6 help files provide no information on working with Excel objects. I have been using the Excel 2003 help
files to see what objects are available, but when I try most of what it provides VB6 chokes on it. Here's the latest that
I've been able to find and try:
.ChartType = xlXYScatterLinesNoMarkers
.SetSourceData Source:=wkbExcel.Worksheets(1).Range(strSourceData), _
.HasTitle = True
sr = Selection.ShapeRange
sr.Line.ForeColor.RGB = RGB(255, 0, 0)
sr is Dim'd as ShapeRange, as per the help file. It chokes on the Selection.ShapeRange, which was also written precisely as
per the help file.
BTW, it's just for test purposes that I'm trying to set the line to red, so that I can see
whether the change I'm trying to make does actually appear. Of course I'll change it back to black once I'm there.