I am using the following lines of VBA to set the size/position of an Excel selection I just pasted into PowerPoint:
Set Shp = _
PPApp.ActivePresentation.Slides( _
PPApp.ActiveWindow.Selection.SlideRange.slideindex).Shapes(3)
Shp.ScaleHeight 0.75, msoCTrue
Shp.ScaleWidth 0.75, msoCTrue
Shp.Left = 0.58
Shp.Top = 1.6
However, after the macro runs, my shape has horizontal position of 0.01" from the top left corner and a vertical position of "0.02" from the top left corner. Based on my code, the position should be 0.58 and 1.6. Any ideas of why the position is not being set properly?
To add to what Tim's said, PowerPoint uses points as its system of measurement, at least for purposes of automation, so do this instead:
Shp.Left = 0.58 * 72
Shp.Top = 1.6 * 72
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With