Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default vba problem with non writable chart height property

Hi All,

I'm trying, using a VBA macro, to set the ChartArea.Height property of an
Excel Graph object
but I'm getting the following error:

Run-time error '1004': Unable to set the Height of the ChartArea class

According to the MSDN documentation the Height is read-write



My code is below. If anyone can shed some light on this it would be greatly
appreciated.

I'm using Excel Small Business 2003

Regards,

Patrick

Sub Macro1()
''
Dim hauteur As Double
'
hauteur = 400#

Sheets("Graph1").Select
ActiveChart.ChartArea.Select
Selection.Height = hauteur
ActiveChart.ChartArea.Copy
End Sub

Remark

I know that if the graph is within a spreadsheet I could use:
ActiveSheet.ChartObjects("Graph1").Height = hauteur
but the graph is within a graph sheet and this does not run as there is no
ChartObjects in a Graph Sheet



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default vba problem with non writable chart height property

Hi Patrick,

A chart-sheet's chart-area dimensions are determined by page setup and in
particular the margins.

Regards,
Peter T

"ppcm" wrote in message
...
Hi All,

I'm trying, using a VBA macro, to set the ChartArea.Height property of an
Excel Graph object
but I'm getting the following error:

Run-time error '1004': Unable to set the Height of the ChartArea class

According to the MSDN documentation the Height is read-write



My code is below. If anyone can shed some light on this it would be

greatly
appreciated.

I'm using Excel Small Business 2003

Regards,

Patrick

Sub Macro1()
''
Dim hauteur As Double
'
hauteur = 400#

Sheets("Graph1").Select
ActiveChart.ChartArea.Select
Selection.Height = hauteur
ActiveChart.ChartArea.Copy
End Sub

Remark

I know that if the graph is within a spreadsheet I could use:
ActiveSheet.ChartObjects("Graph1").Height = hauteur
but the graph is within a graph sheet and this does not run as there is no
ChartObjects in a Graph Sheet





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
Row height setting problem Machinist60[_2_] Excel Discussion (Misc queries) 4 July 8th 11 12:19 AM
Row Height property CY Excel Discussion (Misc queries) 1 September 21st 07 05:50 AM
Row height problem [email protected] Excel Discussion (Misc queries) 1 December 19th 06 04:43 AM
Formula in a writable field Quinn Ramsey Excel Worksheet Functions 3 November 15th 05 04:35 PM
Add property problem Stuart[_21_] Excel Programming 2 October 7th 05 02:55 PM


All times are GMT +1. The time now is 07:26 AM.

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"