+ Reply to Thread
Results 1 to 8 of 8

Copying charts and tables from excel to powerpoint

  1. #1
    Registered User
    Join Date
    07-14-2017
    Location
    Toronto
    MS-Off Ver
    Excel 2016
    Posts
    6

    Copying charts and tables from excel to powerpoint

    I have an excel file with some charts and tables and I would like to make a macro that copies these charts and tables from excel to an already existing powerpoint presentation on different slides, any help would be appreciated.

  2. #2
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Copying charts and tables from excel to powerpoint

    You were not very specific in how you wanted everything copied etc, but this should get you started...

    To test the code:
    - open up a new blank PowerPoint presentation
    (ensure that is the only one open!)
    - open the attached file
    - run the macro with {CTRL} t
    - 6 sheets are added to the open presentation

    The macro:
    - loops through each worksheet
    - copies every chart
    - pastes to a new slide
    - loops through each worksheet
    - copies every "Excel Table" (ie those created with Insert\Table)
    - pastes to a new slide
    - loops through every named range with name beginning "pp_"
    - copies that range
    - pastes to a new slide

    Credit
    - this code started with what was found on this Peltier Tech page

    The code:
    Please Login or Register  to view this content.
    When creating your macro in a different Excel file:
    REMEMBER to set VBE reference to Microsoft PowerPoint Object Library
    (under VBA menu Tools\References)

    VBARef.jpg
    Attached Files Attached Files
    Last edited by kev_; 07-21-2017 at 02:25 AM.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  3. #3
    Registered User
    Join Date
    07-14-2017
    Location
    Toronto
    MS-Off Ver
    Excel 2016
    Posts
    6

    Re: Copying charts and tables from excel to powerpoint

    Thanks but what i really need to know is how to paste a powerpoint already saved down. I dont want to create a new one. Additionally I want to paste to specific slides I dont need to create new ones or use any loops.
    Last edited by deanle91; 07-21-2017 at 09:40 AM.

  4. #4
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Copying charts and tables from excel to powerpoint

    I dont want to create a new one
    - my VBA does not create a new powerpoint - it merely adds the 6 slides (based on contents of my example workbook) to the active presentation (I told you to open a blank new one to allow you to test what the VBA is doing)

    I want to paste to specific slides
    Very simply
    this line in Excel VBA copies a specific chart named "Chart 2" and which is on sheet "Chart 1"
    Please Login or Register  to view this content.
    this line pastes it into slide 3 in the active presentation and selects it so that we can then move it etc
    Please Login or Register  to view this content.
    If you need more help please be specific in your questions
    Last edited by kev_; 07-21-2017 at 04:29 PM.

  5. #5
    Registered User
    Join Date
    07-14-2017
    Location
    Toronto
    MS-Off Ver
    Excel 2016
    Posts
    6

    Re: Copying charts and tables from excel to powerpoint

    Ok thanks

    I tried just running this code but I am getting Run-time error '429' ActiveX component cant create object

    Please Login or Register  to view this content.

  6. #6
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Copying charts and tables from excel to powerpoint

    Are you writing your code in Excel?

    I think your code could not find the active presentation - how were you activating it?

    This (tested) code successfully copies "Chart 2" on sheets "English" to slide 15 in the active presentation

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    07-14-2017
    Location
    Toronto
    MS-Off Ver
    Excel 2016
    Posts
    6

    Re: Copying charts and tables from excel to powerpoint

    Ok great the new code works now

    Is there a way to paste it using the 'destination theme and embedded workbook' instead of picture so it matches the theme of the presentation?

  8. #8
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Copying charts and tables from excel to powerpoint

    Try this

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Copying excel charts into powerpoint slide
    By Junker2017 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-19-2017, 01:21 PM
  2. Copying multiple tables from Excel into Powerpoint slides
    By OliverBrain in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-29-2015, 11:44 AM
  3. Copying Multiple Charts from Excel to PowerPoint
    By jkamau254 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-02-2014, 01:44 PM
  4. Copy excel charts/graphs to Powerpoint with/without copying worksheet
    By ThomasCarter in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 11-12-2012, 09:05 AM
  5. Copying Excel tables from Powerpoint to an Excel file
    By Azul in forum PowerPoint Formatting & General
    Replies: 0
    Last Post: 08-22-2012, 05:39 PM
  6. Replies: 0
    Last Post: 05-14-2008, 04:16 AM
  7. [SOLVED] Problems copying charts into PowerPoint
    By B&WCHARTS in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 06-02-2006, 12:50 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1