![]() |
Adding shape-type textbox into excel chart sheet
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) |
Adding shape-type textbox into excel chart sheet
Code ran fine for me.
-- Regards, Tom Ogilvy 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) |
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) |
All times are GMT +1. The time now is 08:01 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com