Pasting and Resizing an Excel Range into Powerpoint using VBA

spartanexcel

New Member
Joined
Feb 26, 2014
Messages
7
Hello,
I've searched several forums and have been unable to come up with a solution this problem.

Typically when I bring Excel data (charts or cell ranges) I use Enhanced MetaFiles. They seem to keep the powerpoint file small in size, and maintains formatting. I can also adjust the size of the object once it's pasted into Powerpoint.

I now I have need to do manipulate excel filters and then copy/pastespecial the range to powerpoint using VBA.

I've been able to paste the graphic as an Enhanced Metafile using the following line, where PPSlide is a slide:
PPSlide.Application.ActiveWindow.View.PasteSpecial DataType:=ppPasteEnhancedMetafile

What I'm trying to do is paste the metafile into a Shape variable, so I can reference the variable to position and size the object properly. It seems that I'm pasting as a ShapeRange or Range object, so .Width, .Height, .Left, and .Top all create errors.

Any thoughts on how to paste an excel range into excel using Enhanced Metafile, with the ability to size/position it?

Using Office 2013. Powerpoint Macro recorder is unavailable.
Thanks.
 
Hmmm, I didn't think when you copied over with vba that PowerPoint resized the image automatically
 
Upvote 0

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Hi Chris,

...even when I copied manually from excel table to PowerPoint (table with many columns), PowerPoint will resize it automatically.
 
Upvote 0
Hi Chris,

...even when I copied manually from excel table to PowerPoint (table with many columns), PowerPoint will resize it automatically.

I see what you are saying, I must have been thinking back to an older version of PowerPoint that didn't do the Auto-Resize automatically. I couldn't find any setting that would turn this off, but you could resize the image to a larger size with VBA (ie make the table the size of the slide)
 
Upvote 0

Forum statistics

Threads
1,215,599
Messages
6,125,751
Members
449,258
Latest member
hdfarid

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