View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Adding shape-type textbox into excel chart sheet

Chart sheet protected?

Regards,
Peter T

wrote in message
oups.com...
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(msoTextOrientationHo rizontal, 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)