Change font in graph

mrroland

Active Member
Joined
Apr 29, 2002
Messages
294
Hi,

I inherrited this script from someone else and can't really understand it. What the script will do is create a graph with all kind of balloons. Within this balloon a number will appear. Now the problem is that the font of this number is white. This is hard to read so we want it black. However, struggling to find the correct syntax

This is part of the code where i think the correction needs to be made

Any feedback would greatly be appreciated.

Set shp = wsg.Shapes.AddShape(msoShapeOval, X, Y, 16, 16)
shp.Fill.ForeColor.RGB = RGB(corR, corG, corB)
shp.Name = "shp" & linha
' Set hyp = shp.Hyperlink.
' shp.Hyperlink.Address ("Data!A1:B2")
ReDim Preserve ashp(shpcont)
ashp(shpcont) = shp.Name
Set tf = shp.TextFrame
tf.Characters.Text = valcol
tf.Characters.Font.Size = 6
tf.HorizontalAlignment = xlHAlignCenter
tf.VerticalAlignment = xlVAlignCenter
End If

Kind regards,
Roland
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
One more question

What is the correct syntax the undo the wrapping of the texbox?

tried below but again a syntax error ...
tf.WordWrap = msoFalse

regards,
Roland
 
Upvote 0
Tried it

Dim UnWrap As Boolean
tf.TextWrapping = UnWrap

When it builds the graph it returns
Object does not support this property or method
 
Upvote 0
Thanks for all your assistance. Discovered that tf was actually a textframe so it would never support it. It needs to be set a shape.

This worked for me
shp.TextFrame2.WordWrap = msoFalse

Thanks again for helping

Cheers,
Roland
 
Upvote 0

Forum statistics

Threads
1,216,616
Messages
6,131,757
Members
449,670
Latest member
ryanrodgers2014

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top