Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Object doesn't support this property or method

I am trying to add a text box to all my charts. I want to move the text box
to the lower right corner. My macro keeps returning this error at the point
in the macro where the text box gets moved and re-shaped. Any help would be
greatly appreciated.

Option Explicit

Sub Copyright()

Dim chtobj As ChartObject
For Each chtobj In ActiveSheet.ChartObjects
With chtobj.Chart.TextBoxes.Add(131, 80, 86, 17)
.Select
.AutoSize = True
.Formula = "='12 Charts'!$O$2"
End With
Selection.ShapeRange.IncrementLeft 45.74
Selection.ShapeRange.IncrementTop 64.49
Selection.ShapeRange.ScaleHeight 0.73, msoFalse, msoScaleFromBottomRight
Next chtobj
End Sub



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Object doesn't support this property or method

Sub aa_Tester9()
Dim chtobj As ChartObject
Dim tbox As TextBox
For Each chtobj In ActiveSheet.ChartObjects
Set tbox = chtobj.Chart.TextBoxes.Add(131, 80, 86, 17)
With tbox
.Select
.AutoSize = True
.Formula = "='12 Charts'!$O$2"
End With
With chtobj.Chart.Shapes(tbox.Name)
.IncrementLeft 45.74
.IncrementTop 64.49
.ScaleHeight 0.73, msoFalse, msoScaleFromBottomRight
End With
Next chtobj
End Sub


Worked for me.

Regards,
Tom Ogilvy

"Rick Campbell" wrote in message
rthlink.net...
I am trying to add a text box to all my charts. I want to move the text

box
to the lower right corner. My macro keeps returning this error at the

point
in the macro where the text box gets moved and re-shaped. Any help would

be
greatly appreciated.

Option Explicit

Sub Copyright()

Dim chtobj As ChartObject
For Each chtobj In ActiveSheet.ChartObjects
With chtobj.Chart.TextBoxes.Add(131, 80, 86, 17)
.Select
.AutoSize = True
.Formula = "='12 Charts'!$O$2"
End With
Selection.ShapeRange.IncrementLeft 45.74
Selection.ShapeRange.IncrementTop 64.49
Selection.ShapeRange.ScaleHeight 0.73, msoFalse,

msoScaleFromBottomRight
Next chtobj
End Sub





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Object doesn't support this property or method

Thanks Tom! Works like a charm.

Rick

"Tom Ogilvy" wrote in message
...
Sub aa_Tester9()
Dim chtobj As ChartObject
Dim tbox As TextBox
For Each chtobj In ActiveSheet.ChartObjects
Set tbox = chtobj.Chart.TextBoxes.Add(131, 80, 86, 17)
With tbox
.Select
.AutoSize = True
.Formula = "='12 Charts'!$O$2"
End With
With chtobj.Chart.Shapes(tbox.Name)
.IncrementLeft 45.74
.IncrementTop 64.49
.ScaleHeight 0.73, msoFalse, msoScaleFromBottomRight
End With
Next chtobj
End Sub


Worked for me.

Regards,
Tom Ogilvy

"Rick Campbell" wrote in message
rthlink.net...
I am trying to add a text box to all my charts. I want to move the text

box
to the lower right corner. My macro keeps returning this error at the

point
in the macro where the text box gets moved and re-shaped. Any help would

be
greatly appreciated.

Option Explicit

Sub Copyright()

Dim chtobj As ChartObject
For Each chtobj In ActiveSheet.ChartObjects
With chtobj.Chart.TextBoxes.Add(131, 80, 86, 17)
.Select
.AutoSize = True
.Formula = "='12 Charts'!$O$2"
End With
Selection.ShapeRange.IncrementLeft 45.74
Selection.ShapeRange.IncrementTop 64.49
Selection.ShapeRange.ScaleHeight 0.73, msoFalse,

msoScaleFromBottomRight
Next chtobj
End Sub








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Object doesn't support this property or method" in Excel 2003 rhiski12 Excel Discussion (Misc queries) 3 November 24th 08 03:58 PM
runtime error 434, object does not support this method or property Janis Excel Discussion (Misc queries) 4 January 17th 08 04:10 PM
VBA error: "object doesn't support this property or method" Dave F Excel Discussion (Misc queries) 2 April 23rd 07 06:04 PM
object reference does not support this property or method [email protected] Excel Discussion (Misc queries) 2 June 14th 06 07:23 PM
Object doesn't support this property or method (Error 438) Kiran Excel Discussion (Misc queries) 1 July 12th 05 08:42 PM


All times are GMT +1. The time now is 10:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"