Images resizing when excel range is pasted into PPT using VBA across different Operating system

Joined
May 23, 2017
Messages
1
Hi,

I have automated a process of pasting Excel ranges as images into PPT through VBA. The dimensions like ".width",".height",".left" and ".top" are set after pasting the image.

I was initially working on Windows 7 and had the dimensions according to them. But when I tried to use the same macro in Windows 8, the size of pasted images is stretched too wide. I am confused around why this is happening even when I have defined the dimensions before hand.

Any help is much appreciated.
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Try unlocking the aspect ratio of the image before setting the size/position after pasting. For one of my programs PPT was stretching the image to max width when pasting it in VBA and this change fixed the problem.
Selection.ShapeRange.LockAspectRatio = msoFalse
 
Upvote 0

Forum statistics

Threads
1,215,516
Messages
6,125,280
Members
449,220
Latest member
Excel Master

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top