Howdy all,
So I'm knee-deep in some code where I'm trying to update a chart title with data and have multiple fonts in the chart title, so I'm adding a textbox and using that method
The code below seems to be doing what I want, but when I get to the last line (actually adding the textbox), it bombs out saying "Runtime error -2147417848 (80010108) Method 'add" of object "textboxes' failed.
Any thoughts on why I can't add this text box to this chart?
So I'm knee-deep in some code where I'm trying to update a chart title with data and have multiple fonts in the chart title, so I'm adding a textbox and using that method
The code below seems to be doing what I want, but when I get to the last line (actually adding the textbox), it bombs out saying "Runtime error -2147417848 (80010108) Method 'add" of object "textboxes' failed.
Any thoughts on why I can't add this text box to this chart?
Code:
Set cht = ActiveChart
' Add a blank title
cht.HasTitle = True
Set chtT = cht.ChartTitle
chtT.Text = vbLf
'Set chart title variables
ChartTitleLine1 = myLine1
If z = 3 Then
ChartTitleLine2 = "PTS Actual/Projected FTE Utilisation"
Else
ChartTitleLine2 = "PTS Actual/Projected FTE Utilisation by Asset"
End If
ChartTitleLine3 = Range("message18M").Value
LenTitleLine1 = Len(ChartTitleLine1)
LenTitleLine2 = Len(ChartTitleLine2)
LenTitleLine3 = Len(ChartTitleLine3)
'Remove existing textboxes on chart tabs
If cht.TextBoxes.Count > 0 Then
cht.TextBoxes.Delete
End If
' Add and format textbox
Set txtB = cht.TextBoxes.Add(chtT.Left + 50, chtT.Top, 100, 50)