Graphs - How to change the chart type using vba code?

vman21

Registered User.
Local time
Today, 07:36
Joined
Feb 25, 2014
Messages
18
Hi guys,

I have been looking for a brief tutorial in using MSGraph but failed to find a good one. Most of the search results points me to forums. Mainly, I am trying to change the chart type on a MSGraph control that I have added on my form. However, there is no graph.ChartType

OLE Class: Microsoft Graph Chart
Class: MSGraph.Chart.8
 
Agree with you. It is difficult to find information about this subject. And hints like "record a macro in Excel and use the code" does not work either.
But...
Me.yourgraph.chartType = 74 ' Scatter
Me.yourgraph.chartType = 65 ' Line

does work, allthough Access does not show the property when typing

Ben
 
Last edited:
Dear apr pillai

I had read your posts already, very informative, thank you. I am using also parts of it

I still am searching for one answer.
When I have a graph with two lines, the first line should be with line and markers, but the second one only markers. Under properties you could easily exclude the line and have only the markers, but how should I do this in VBA?

I tried several things, searched MSDN the series object, but I come nowhere. Maybe you know the clue or a trick?

Many thanks

Ben
 
Last edited:
Try the below.
Code:
Me.YourGraphName.SeriesCollection(1).Border.LineStyle = 0
 
I had tried many numbers, but never 0
It is so simple as finding grass on a lawn, thinking grass is purple :-)
Thank you JHB
 
You're welcome, (yes sometimes it is not to see the forest for the trees). :)
 

Users who are viewing this thread

Back
Top Bottom