How to size MS Graph within Powerpoint using VBA?

B

Bernd Bubis

Dear all,

desperately, I am trying to size an MS Graph chart within a powerpoint
presentation using VBA.

My VBA code so far looks something like this ...

Sub Example()
Dim MyShape As Object
Dim oGraph As Object
Dim oDatasheet As Object
Dim oChart As Object
'whereas MS Graph shape is selected
Set MyShape = ActiveWindow.Selection.ShapeRange(1)
Set oGraph = MyShape.OLEFormat.Object
Set oDatasheet = oGraph.Application.DataSheet
Set oChart = oGraph.Application.Chart
oGraph.Width = 300
End Sub

My main problem is, that the line ...
oGraph.Width = 300
does not really work. It does change the size of MS Graph - but
unfortunately in an unpredictable way - at least for me.

Can anyone help?

Thanx in advance!

xxccii
 

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