#1   Report Post  
Posted to microsoft.public.excel.charting
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"

  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2,489
Default Chart title VBA

Hi,

Your chart needs data series in it before you can add and alter the chart
title

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"graham_s" wrote in message
...
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"


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chart title syssupspe Charts and Charting in Excel 1 September 11th 07 09:51 AM
Formula in Chart Title Phil Hageman Charts and Charting in Excel 9 April 10th 07 06:15 AM
Excel chart - how to assign the file name in the chart title? TGreen Charts and Charting in Excel 1 August 16th 05 10:35 AM
Pasting Objects into Chart title and Axis title Sam Charts and Charting in Excel 1 June 6th 05 08:50 PM
Chart Title LDanix Charts and Charting in Excel 2 January 17th 05 10:02 AM


All times are GMT +1. The time now is 09:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"