Hello
I have been working most of the day trying to get Excel to talk to PowerPoint. I am on Version 2007..
What I want to do is run a macro in Excel, have that macro copy a few columns then .COPY so it will be in the clip board.
I then want to switch to PowerPoint and Paste-Special as a Windows Meta File.
Does anyone have a short code snipit perhaps they could share?
Thanks in advance.
Try this
You will need to set up a reference in Excel to the Microsoft PowerPoint Object Library.Sub Test() Dim PPApp As PowerPoint.Application Dim PPPRes As PowerPoint.Presentation Dim PPSlide As PowerPoint.Slide Dim pptLayout As PowerPoint.CustomLayout Dim MyShapes As PowerPoint.Shapes Set PPApp = New PowerPoint.Application PPApp.Visible = msoTrue Set PPPRes = PPApp.Presentations.Add Set pptLayout = PPPRes.SlideMaster.CustomLayouts(1) Set PPSlide = PPPRes.Slides.AddSlide(1, pptLayout) Range("A1:A2").Copy Set MyShapes = PPPRes.Slides(1).Shapes MyShapes.PasteSpecial(2).Select End Sub
Martin
Eighty Twenty Spreadsheet Automation http://homepage.ntlworld.com/martin.rice1/ for all your Excel customisation and consulting needs.
If my solution has saved you time and/or money, please consider donating to Cancer Research UK.
Thank you for the quick reponse. Can you tell me how I would/could setup a reference in excel?
I see you have:
Range("A1:A2").Copy
Will that 'Paste Special'? I am wanting to copy images from Excel such as graphs into PowerPoint.
thanks
Set up a reference by going into the VBA editor and selecting Tools - References and then Microsort Powerpoint (12) from the long list of libraries.
Your original post didn't specify what type of thing you wanted to copy from Excel. However, the method should work for most things that you might want to copy.
Martin
Eighty Twenty Spreadsheet Automation http://homepage.ntlworld.com/martin.rice1/ for all your Excel customisation and consulting needs.
If my solution has saved you time and/or money, please consider donating to Cancer Research UK.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks