PDA

Click to See Complete Forum and Search --> : Changing MSChart97 properties from Access


Richyrich
May 4th, 2000, 10:51 PM
I've been trying to change the properties of an imbedded OLE object (MSChart97 chart) at runtime from an MSAccess database. I can change the chart title, but cannot change the axis titles in code as I cannot find how to reference them. I've been told that I can export the data to Excel, draw the graph there using a macro and then import the OLE object back into Access. This however is a bit of a nightmare too (the graph comes back in black and white). Can anyone help? - or at least tell me where a useful help file is located?

Thanks
Richyrich

Mongo
May 5th, 2000, 10:02 AM
The ChartWizard method may help, also check MSDN article Q147803. Code snippet:

Dim TheChart As Chart
Set TheChart = ActiveSheet.ChartObjects(1).Chart
' reformat Chart1 as line chart, adds legend, category and value axis titles.
TheChart.ChartWizard Gallery:=xlLine, HasLegend:=True, CategoryTitle:="X-axis", ValueTitle:="Y-Axis"