V
vanhalsen
Hi,
have a problem with resizing some charts. What i wanna do is to select
a coupls of charts and make them all the same height and width. I
figured out that the value i received from the chart itself is not
comparable to the same value in ppt. (e.g. a chart with a width of 300
points is not the same width than another shape in powerpoint with a
width of 300 points).
Now i wanted to get the width of the first chart choosen and apply it
to all others, unfortunatly this won't work either. For whatever reason
it mentions that the width is the same but if you have a look at the
screen it differs.
Here is my sample code
Sub TestWidth
Set MyShape = ActiveWindow.Selection.ShapeRange
MyShape(2).OLEFormat.Object.Application.Chart.Width =
MyShape_(1).OLEFormat.Object.Application.Chart.Width
Debug.Print "Chart1 W" &
MyShape(1).OLEFormat.Object.Application.Chart.Width
Debug.Print "Chart2 W" &
MyShape(2).OLEFormat.Object.Application.Chart.Width
Debug.Print "Shape1 W" & MyShape(1).Width
Debug.Print "Shape1 W" & MyShape(2).Width
End Sub
you have to create to MS Graph charts with different widths, select
them and start the macro. any ideas? help? work arounds?
thanks
vanhalsen
have a problem with resizing some charts. What i wanna do is to select
a coupls of charts and make them all the same height and width. I
figured out that the value i received from the chart itself is not
comparable to the same value in ppt. (e.g. a chart with a width of 300
points is not the same width than another shape in powerpoint with a
width of 300 points).
Now i wanted to get the width of the first chart choosen and apply it
to all others, unfortunatly this won't work either. For whatever reason
it mentions that the width is the same but if you have a look at the
screen it differs.
Here is my sample code
Sub TestWidth
Set MyShape = ActiveWindow.Selection.ShapeRange
MyShape(2).OLEFormat.Object.Application.Chart.Width =
MyShape_(1).OLEFormat.Object.Application.Chart.Width
Debug.Print "Chart1 W" &
MyShape(1).OLEFormat.Object.Application.Chart.Width
Debug.Print "Chart2 W" &
MyShape(2).OLEFormat.Object.Application.Chart.Width
Debug.Print "Shape1 W" & MyShape(1).Width
Debug.Print "Shape1 W" & MyShape(2).Width
End Sub
you have to create to MS Graph charts with different widths, select
them and start the macro. any ideas? help? work arounds?
thanks
vanhalsen