I have an MS Acces Db. I have a command button to export (TransferSpreadsheet acExport) a query to Excel and create a Chart (Set ch = ws.Shapes.AddChart.Chart)
This is my code working fine:
With ch
.ChartType = xlColumnClustered
.SeriesCollection(2).AxisGroup = 2
.SeriesCollection(2).ChartType = xlLineMarkers
.ChartGroups(1).GapWidth = 69
.Axes(xlValue).MajorGridlines.Delete
.Axes(xlCategory, xlPrimary).HasTitle = False
.Axes(xlValue, xlPrimary).HasTitle = False
.SetElement (msoElementLegendBottom)
End with
I need to set a chart's axis maximum and minimum values using vba. I need to refer to chart already in the worksheet.
Any time I add to my code:
.MaximumScale = ActiveSheet.Range("Axis_max").Value
.MinimumScale = ActiveSheet.Range("Axis_min").Value
VBA displays ERROR 1004 “Application-defined or Object” I'm confused why my code does not run those instructions
I really would be grateful if someone could give me a steer on this,
All the best