N
navin
Hi All,
I have a sheet, which has close to 20 charts, with different size
(height and width). I want to run a macro, which will make all the
charts in the sheets of same size (height and width). I tried defining
the chart object in the below code:
Sub test()
'
' test Macro
' Macro recorded 3/23/2007 by E366091
'
' Keyboard Shortcut: Ctrl+q
'
Dim ChtOb As ChartObjects
Set ChtOb = ActiveSheet.ChartObjects
For Each ChtOb in ChartObjects
ChtOb.Height=100
ChtOb.width=100
Next ChtOb
End Sub
Above code works properly, and sets ChtOb to ActiveSheet.ChartObjects
but when it comes to the next line it gives error as Object Required.
Please let me know as what is wrong with the code. Any suggestion is
appreciated.
Thanks,
Navin
I have a sheet, which has close to 20 charts, with different size
(height and width). I want to run a macro, which will make all the
charts in the sheets of same size (height and width). I tried defining
the chart object in the below code:
Sub test()
'
' test Macro
' Macro recorded 3/23/2007 by E366091
'
' Keyboard Shortcut: Ctrl+q
'
Dim ChtOb As ChartObjects
Set ChtOb = ActiveSheet.ChartObjects
For Each ChtOb in ChartObjects
ChtOb.Height=100
ChtOb.width=100
Next ChtOb
End Sub
Above code works properly, and sets ChtOb to ActiveSheet.ChartObjects
but when it comes to the next line it gives error as Object Required.
Please let me know as what is wrong with the code. Any suggestion is
appreciated.
Thanks,
Navin