ExcelTip.com
Account Icon Account Icon Account Icon
ExcelTip.com

Go Back   Excel Help Forum > Usenet Groups > Excel 2007 Help

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-30-2008, 03:49 PM
ZavNice ZavNice is offline
Registered User
 
Join Date: 22 May 2008
Location: New Jersey
Posts: 44
ZavNice is on a distinguished road
Text Box Error

Hello everyone. I'm recieving a Run-Time Error that says "The item with the specified name wasn't found". It's point to this line of
Code:
ActiveChart.Shapes("Text Box 2").Select
The code with it is
Code:
Sheets("Chart1").Select
ActiveChart.Shapes("Text Box 2").Select
ActiveChart.Shapes("Text Box 2").Top = 12
ActiveChart.Shapes("Text Box 2").Height = 18
ActiveChart.Shapes("Text Box 2").Width = 120
ActiveChart.Shapes("Text Box 2").Left = 510

ActiveSheet.TextBoxes.Add(487003.5, 0, 1742961, 220063.5).Select
ActiveChart.Shapes("Text 3").Select
ActiveChart.Shapes("Text 3").Height = 18
ActiveChart.Shapes("Text 3").Width = 120
ActiveChart.Shapes("Text 3").Top = 1
ActiveChart.Shapes("Text 3").Left = 65
Selection.Characters.Text = "Citigroup Internal"
With Selection.Characters(Start:=1, Length:=18).Font
    .Name = "Arial"
    .FontStyle = "Bold"
    .Size = 12
    .Strikethrough = False
    .Superscript = False
    .Subscript = False
    .OutlineFont = False
    .Shadow = False
    .Underline = xlUnderlineStyleNone
    .ColorIndex = 5
End With
'Selection.ShapeRange.ScaleHeight 0.78, msoFalse, msoScaleFromTopLeft
ActiveChart.Shapes("Text Box 1").Select
ActiveChart.Shapes("Text Box 1").Top = 22
ActiveChart.Shapes("Text Box 1").Height = 28
ActiveChart.Shapes("Text Box 1").Left = 65
Selection.AutoScaleFont = False
With Selection.Characters(Start:=1, Length:=18).Font
    .Name = "Arial"
    .FontStyle = "Regular"
    .Size = 12
    .Strikethrough = False
    .Superscript = False
    .Subscript = False
    .OutlineFont = False
    .Shadow = False
    .Underline = xlUnderlineStyleNone
    .ColorIndex = xlAutomatic
End With
I will appreciate anyone's help. Thanks.
Reply With Quote
  #2  
Old 08-01-2008, 07:27 PM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
Administrator
 
Join Date: 02 Mar 2004
Location: Cheshire, UK
Posts: 4,104
Simon Lloyd will become famous soon enough Simon Lloyd will become famous soon enough
You will probably find it's a typo!
Text Box 2 should really look like TextBox2 unless you changed it!
__________________
Regards,
Simon

Please read this before cross posting!
Please always give feedback...good or bad!

Please take the time to read the Forum Rules before posting!
Reply With Quote
  #3  
Old 08-05-2008, 05:22 PM
ZavNice ZavNice is offline
Registered User
 
Join Date: 22 May 2008
Location: New Jersey
Posts: 44
ZavNice is on a distinguished road
After I changed Text Box 2 to TextBox 2, I recieved an error for
Code:
ActiveSheet.TextBoxes.Add(487003.5, 0, 1742961, 220063.5).Select
It was a Run-Time error '1004' which stated "Unable to get the Add property of the TextBoxes class".
Reply With Quote
  #4  
Old 08-05-2008, 05:48 PM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
Administrator
 
Join Date: 02 Mar 2004
Location: Cheshire, UK
Posts: 4,104
Simon Lloyd will become famous soon enough Simon Lloyd will become famous soon enough
You cannot add the textbox and select it at the same time!
__________________
Regards,
Simon

Please read this before cross posting!
Please always give feedback...good or bad!

Please take the time to read the Forum Rules before posting!
Reply With Quote
  #5  
Old 08-06-2008, 03:51 PM
ZavNice ZavNice is offline
Registered User
 
Join Date: 22 May 2008
Location: New Jersey
Posts: 44
ZavNice is on a distinguished road
I fixed the problem I was having. For the
Code:
ActiveSheet.TextBoxes.Add(487003.5, 0, 1742961, 220063.5).Select
I changed it to
Code:
ActiveChart.Shapes.AddTextbox(msoTextOrientationHorizontal, 391.58, 7.11, _
        273.95, 44.24).Select
And their was no error after that.
Reply With Quote
Reply

Bookmarks

New topics in Excel 2007 Help


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump


All times are GMT -4. The time now is 03:28 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0