Greetings,
Has anybody out there been able to generate a textbox on an MS Excel Chart? I have created a many excel reports in the past, but never had a requirement to enter a textbox until now. As in the past, I have created the chart and used excel to record a macro, took that code into LS and translated, but it keeps booming out! Not sure what I’m missing here. The code errors out at Selection.Characters.Text = “Unique Full Application Submissions” line.
Here’s the culprit:
xlChart.PlotArea.Select
Selection.Left = 9
Selection.Top = 26
ActiveChart.Axes(1).Select ' xlCategory
Selection.TickLabels.AutoScaleFont = True
With Selection.TickLabels.Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 9
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = -4142 ' xlUnderlineStyleNone
.ColorIndex = -4105 ' xlAutomatic
.Background = -4105 ' xlAutomatic
End With
xlChart.Shapes.AddTextbox(1, 251, 406, 193, 29).Select
Selection.Characters.Text = "Unique Full Application Submissions"
Selection.AutoScaleFont = False
With Selection.Characters(Start:=1, Length:=35).Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = -4142 ' xlUnderlineStyleNone
.ColorIndex = -4105 ' xlAutomatic
End With
With Selection
.HorizontalAlignment = -4108 ' xlCenter
.VerticalAlignment = -4160 ' xlTop
.ReadingOrder = -5002 ' xlContext
.Orientation = -4128 ' xlHorizontal
.AutoSize = False
End With