Thread: Chart title VBA
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.charting
graham_s graham_s is offline
external usenet poster
 
Posts: 3
Default Chart title VBA

Further to previous....

I cannot set the chart title, the lines;
oChart.Chart.HasTitle = True
oChart.Chart.ChartTitle.Characters.Text = "Progress curve"

both return errors, "cannot get..."

I have been using the macro as a go-by but they all refer to activechart.
Why is it that my code fails?

Graham


For i = 1 To 2 ' UBound(mArrUIP, 1)

'add new sheet
mcXL.AddAsLastWorksheet CStr(mArrUIP(i, 1))
Set shtPlot = Worksheets(CStr(mArrUIP(i, 1)))

'add new chart to the new (active) sheet
Set oChart = Worksheets(CStr(mArrUIP(i, 1))).ChartObjects.Add(ChtLeft,
ChtTop, ChtWidth, ChtHeight)
oChart.name = CStr(mArrUIP(i, 1)) & "_1"
oChart.Chart.HasTitle = True
oChart.Chart.ChartTitle.Characters.Text = "Progress curve"