Microsoft Office Chart 9.0 - Major Gridlines LineStyle

L

Lachlan Sharp

I'm using a Microsoft Office Chart 9.0 object in a form
I'm developing (Access 2000), and I seem unable to change
the linstyle of the major or minor gridlines.

The code I am using is as follows:
Chrt.Axes(1).HasMajorGridlines = True
Chrt.Axes(1).MajorGridlines.Line.LineStyle = wcLineStyleDot

Where Chrt is a OWC.WCChart Object.

The error I get is:
Run Time Error '445':
Object doesn't support this action

LineStlye appears to be a legitamite member of the line
object, so I am at a loss what to do. I have been able to
succesfully create the graph and add data series, but this
I have been unable to do. Ominously, all examples I have
found on the internet that work with the Gridlines only
change the color and the weight.

Thanks

Lachlan
 
F

fredg

I'm using a Microsoft Office Chart 9.0 object in a form
I'm developing (Access 2000), and I seem unable to change
the linstyle of the major or minor gridlines.

The code I am using is as follows:
Chrt.Axes(1).HasMajorGridlines = True
Chrt.Axes(1).MajorGridlines.Line.LineStyle = wcLineStyleDot

Where Chrt is a OWC.WCChart Object.

The error I get is:
Run Time Error '445':
Object doesn't support this action

LineStlye appears to be a legitamite member of the line
object, so I am at a loss what to do. I have been able to
succesfully create the graph and add data series, but this
I have been unable to do. Ominously, all examples I have
found on the internet that work with the Gridlines only
change the color and the weight.

Thanks

Lachlan

Re: Microsoft Office Chart 9.0
Do you mean MSGraph9?

The following code in the Report's Detail Format event works for me
in Access using MS Graph10. Should be the same in Graph9.

Me!OLEUnbound8.Axes(1).MajorGridlines.Border.LineStyle = xlDot
Me.Requery

OLEUnbound8 is the name of the chart object control placed in the
report detail section.

Do you have MSGraph in your references?
If you have it as a reference, placing your cursor on Axes and
pressing F1 would open the Graph Help File to the Axes(object) help
item. From there it's just one more click on the diagram to arrive at
the correct code.

Another 'trick' I learned is to place a test graph in an excel
workbook, and then while recording a macro, make the changes wanted.
Stop the recording and read the excel generated code for a good idea
of how Excel does it. Sometimes, even then, a bit of imagination is
going to be needed when using it in Access, but it is a good start.
 
L

Lachlan Sharp

The graph object I'm using is an Office Web Component
(OWC.WCChart), and there does not appear to be a Border
property of the MajorGridlines object. There is however
the 'Lines' object. I have a reference to the 'Microsoft
Office Web Components 9.0' (MSOWC.dll).

I am able to change the colour and weight of the gridlines
(eg. Chrt.Axes(1).MajorGridlines.Line.Weight = 1), just
not the LineStyle. The Linestyle property appears in the
Visual Basic object browser, but at run-time I get my
afore mentioned error.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top