I am exporting my data to excel through office automation. First three lines
are Report title and subtitle and some other information. Line 4 is coloumn
heading and from line 5 onwards actual data. Based on this data I am
creating column chart. I want to show my column heading as x-axis labels but
it shows 1,2,3,4,.... I dont find how to setup XValue property of chart as
range. Here is my code.
xlColumnClustered = 51
oChart = oleapp.Sheets[1].chartobjects.add(50,225,550,300)
oChart.Activate()
OleApp.ActiveChart.ChartType = xlColumnClustered
OleApp.ActiveChart.SetSourceData(OleApp.Range("B12:M12"))
OleApp.ActiveChart.SeriesCollection.Add("Sheet1!$B$4:$M$4",2,.T.,.T.,.T.)
OleApp.ActiveChart.SeriesCollection[1].HasDataLabels = .T.
OleApp.ActiveChart.HasTitle = .T.
OleApp.ActiveChart.ChartTitle.Caption = "Statewide Rate"
OleApp.ActiveChart.HasLegend = .F.
Can anyone please help.
Thanks.