ActiveChart.ChartTitle.Text = "='Sheet1'!R1C1"
But, there appears to be no way for VBA to detect whether a chart title has
a formula. The statement below, for example, simply displays the chart's
title (not the formula):
MsgBox ActiveChart.ChartTitle.Text
Is this a flaw in the object model, or am I missing something?
----- Posted by John Walkenbach of JWalk & Associates -----
----- Visit "The Spreadsheet Page" -----
----- http://www.j-walk.com/ss -----
Regards,
Dave Braden
Dim txtTitle As TextBox
Set txtTitle = Sheet1.ChartObjects(1).Chart.TextBoxes("Text Box 2")
MsgBox txtTitle.Text & vbCrLf & txtTitle.Formula
--
_______________
Robert Rosenberg
RCOR Consulting
Microsoft MVP - Excel
John Walkenbach <jo...@j-walk.com> wrote in message
news:eY38taqx#GA.265@cppssbbsa05...
> Is this a flaw in the object model, or am I missing something?
It is a flaw (I would have expected .Text to return the visible text,
and .Caption to return the formula), but you can always fall back to
XLM:
'Activate the chart, then use
sTitle = ExecuteExcel4Macro("GET.FORMULA(""Title"")")
which returns either the text of the title, or its formula in R1C1
style.
Regards
Stephen Bullen
Microsoft MVP - Excel
http://www.BMSLtd.co.uk
Thanks,
John
Stephen Bullen <Ste...@BMSLtd.co.uk> wrote in message
news:VA.0000055d.033a82ac@mars...
Ironic, isn't it? There are a number of things that can be done in XLM that
can't be done in VBA. Evidently Stephen is still using the stuff, or has a
prodigous memory (or both).
Dave Braden
-John
Stephen Bullen <Ste...@BMSLtd.co.uk> wrote in message
news:VA.0000055f.0262815d@mars...
> Hi John,
>
> > I'm trying to create a utility that locates every
> > link in a workbook.
>
> What's wrong with Bill's FindLink.xla on my web site?
>
> Ahh - I see it doesn't find links in the chart title, either!
> It gets even more complicated.
Good luck!