Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to dynamically update MS Graph Chart Title from a variable / field

Status
Not open for further replies.

kwareDJ

Programmer
Oct 1, 2012
1
US
Hi, Earlier today I was experiencing problems as described in
thread702-911509

In particular I was regularly getting the error "Unable to set the Text Property of ChartTitle class"
So, I thought I'd post the solution I found to work around the problem.

----

Ok,
I have come to the conclusion that this is all due to some kind of internal memory referencing issue when trying to set mychart.charttitle.text to a value stored in a form field (or within a variable).

My workaround was to set the mychart.tag = myChartTitleVar, then reference the mychart.tag member when setting the charttitle.text

e.g.
[tt]dim h as string

if not(mychart.hastitle) then mychart.hasttitle = true

h = myChart.tag 'placeholder
myChart.tag = sMyChartTitleVar
sMyChart.ChartTitle.text = mychart.tag 'reference the instaniated class member
mychart.tag = h 'reset to former value
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top