Adding shape-type textbox into excel chart sheet

L

linsq2005

Hi all, im currently trying to insert in a textbox into an excel chart
sheet using vb6. However i keep getting a run-time error 1004-
specified value out of range. Below is my code, can anyone actually
pinpoint what is wrong?Thanks a million.


ActiveWorkbook.Sheets("Results Data Chart").Select
ActiveChart.Shapes.AddTextbox(msoTextOrientationHorizontal, 0, 0, 100,
100).Select

Selection.Characters.Text = ""
Selection.AutoScaleFont = True
With Selection.Font
..Name = "Arial"
..FontStyle = "Regular"
..Size = 8
..Strikethrough = False
..Superscript = False
..Subscript = False
..OutlineFont = False
..Shadow = False
..Underline = xlUnderlineStyleNone
..ColorIndex = xlAutomatic
..Background = xlTransparent
End With
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 9
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Line.Weight = 0.75
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineSingle
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoTrue
Selection.ShapeRange.Line.ForeColor.SchemeColor = 8
Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top