Error 1004 with MSGraph ChartArea.Width

M

Mike Clayton

Hi All,

I'm trying to set the ChartArea.Width property of an MS Graph object
embedded in a PowerPoint 2003 presentation but I'm getting the following
error:

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

According to the MSDN documentation the Width is a read-write property so
I'm not sure what the problem is. (see
http://msdn.microsoft.com/library/d...en-us/vbagr11/html/grproWidth1_HV03077602.asp).

My code is below, and the error occurs at line 27. If anyone can shed some
light on this it would be greatly appreciated.

Regards,

Mike

' *** BEGIN CODE ***
Option Explicit

Public Sub UpdateChart()

Dim objSrcShape As PowerPoint.Shape
Dim objSrcChart As Graph.Chart

' get references to the shape and chart objects to manipulate
Set objSrcShape = ActiveWindow.Selection.ShapeRange(1)
Set objSrcChart = objSrcShape.OLEFormat.Object

' resize the powerpoint shape that contains the chart
objSrcShape.Top = 109.875
objSrcShape.Left = 120
objSrcShape.Width = 480
objSrcShape.Height = 320.25

' resize the chart inside the shape
objSrcChart.Top = -32
objSrcChart.Left = -6
objSrcChart.Width = 550
objSrcChart.Height = 397

' resize the chart's chartarea object
' *** (the next line raises the 1004 error) ***
objSrcChart.ChartArea.Width = 473
objSrcChart.ChartArea.Height = 323

' resize the chart's plotarea object
objSrcChart.PlotArea.Top = 8
objSrcChart.PlotArea.Left = 8
objSrcChart.PlotArea.Width = 379
objSrcChart.PlotArea.Height = 297

End Sub
' *** END CODE ***
 
P

Peter Huang [MSFT]

Hi

This is an known issue, we have reported to our product team.
This property is not writtable so far.

Thanks for your feedback!

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
P

Peter Huang [MSFT]

Hi Mike,

Based on my research, there is no workaround so far.
If you still have any concern, I think you may try to contact MSPSS
directly to see if there is any other idea.

http://support.microsoft.com

Thanks for your understanding!

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?TWlrZSBDbGF5dG9u?=,
Is there any recommended work-around in the meantime?
If possible, create an EXCEL chart instead?

Cindy Meister
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top