+ Reply to Thread
Results 1 to 14 of 14

To paste tables in editable form to specific slides of existing PowerPoint document

  1. #1
    Forum Contributor
    Join Date
    09-19-2017
    Location
    London
    MS-Off Ver
    2015
    Posts
    169

    Exclamation To paste tables in editable form to specific slides of existing PowerPoint document

    Hello,

    I am new to VBA and I encountered some issues. My issues are:

    1. I have to paste a lot of tables to specific slides in existing PowerPoint document
    2. All the tables must be editable (in default form) in the slides.
    3. The tables must be positioned as not to affect the header on top of any typical presentation slides.

    Hereby I attached the Excel file which contains the tables. I have also included the info on which table must be in which slide under column K.

    https://drive.google.com/open?id=0B4...VFCb0Jaek40TmM

    Hope you guys can help me as I have a deadline to meet. Your help is really appreciated.

    Have a nice day.

  2. #2
    Forum Contributor
    Join Date
    09-19-2017
    Location
    London
    MS-Off Ver
    2015
    Posts
    169

    Re: To paste tables in editable form to specific slides of existing PowerPoint document

    Please Login or Register  to view this content.
    Here is a code similar to what I want but the problem is this is for chart and it creates new PPT instead of an existing file of PPT. May anyone enlighten me?

  3. #3
    Valued Forum Contributor Maudibe's Avatar
    Join Date
    12-21-2016
    Location
    USA
    MS-Off Ver
    2010-2013
    Posts
    326

    Re: To paste tables in editable form to specific slides of existing PowerPoint document

    ell,

    Just comment out the following 3 lines in the code by placing a " ' " (without the quotes) in front of each line'

    FROM:
    Please Login or Register  to view this content.
    TO:
    Please Login or Register  to view this content.
    [/COLOR]

    Your PowerPoint needs to be open at the time

    HTH,
    Maud

    P.S. Just read the part about the Tables instead of a chart. will post back
    Last edited by Maudibe; 10-01-2017 at 09:41 AM.

  4. #4
    Valued Forum Contributor Maudibe's Avatar
    Join Date
    12-21-2016
    Location
    USA
    MS-Off Ver
    2010-2013
    Posts
    326

    Re: To paste tables in editable form to specific slides of existing PowerPoint document

    Here is the modified code to loop through all your worksheets and copy the tables to new slides on an open existing Powerpoint.

    HTH,
    Maud

    Please Login or Register  to view this content.
    Last edited by Maudibe; 10-01-2017 at 11:08 AM.

  5. #5
    Valued Forum Contributor Maudibe's Avatar
    Join Date
    12-21-2016
    Location
    USA
    MS-Off Ver
    2010-2013
    Posts
    326

    Re: To paste tables in editable form to specific slides of existing PowerPoint document

    Ell,

    I should have downloaded your file prior to starting. You had used the verbiage "Tables" but your workbook does not have any tables in it. You have several groups of data with headers.

    I converted the first 10 groups of data to tables and the above code worked flawlessly in your workbook.

    Either convert your data to tables and use the code above or use different code to copy over a range of cells to PowerPoint slides.

    Maud

  6. #6
    Forum Contributor
    Join Date
    09-19-2017
    Location
    London
    MS-Off Ver
    2015
    Posts
    169

    Re: To paste tables in editable form to specific slides of existing PowerPoint document

    Quote Originally Posted by Maudibe View Post
    Ell,

    I should have downloaded your file prior to starting. You had used the verbiage "Tables" but your workbook does not have any tables in it. You have several groups of data with headers.

    I converted the first 10 groups of data to tables and the above code worked flawlessly in your workbook.

    Either convert your data to tables and use the code above or use different code to copy over a range of cells to PowerPoint slides.

    Maud
    Hi Maud,

    First of all thank you so much for your help. But I could not run the code. May I know what could be the reason?

    Regards.

  7. #7
    Valued Forum Contributor Maudibe's Avatar
    Join Date
    12-21-2016
    Location
    USA
    MS-Off Ver
    2010-2013
    Posts
    326

    Re: To paste tables in editable form to specific slides of existing PowerPoint document

    Ell,

    For the code to work properly, please change your data sets to tables as I have tested this on your worksheet. The second option is to acquire code that will copy a range of data to PowerPoint slides instead of tables

    Maud

  8. #8
    Forum Contributor
    Join Date
    09-19-2017
    Location
    London
    MS-Off Ver
    2015
    Posts
    169

    Re: To paste tables in editable form to specific slides of existing PowerPoint document

    Hi Maud,

    I have changed all the tables to its actual table form but the code seems to have an error which is run-time error 424: Object required. Can I see my worksheet which you have changed to tables form? Thank you so much for your assistance.

    Regards.

  9. #9
    Valued Forum Contributor Maudibe's Avatar
    Join Date
    12-21-2016
    Location
    USA
    MS-Off Ver
    2010-2013
    Posts
    326

    Re: To paste tables in editable form to specific slides of existing PowerPoint document

    Hi Ell,

    Attached is your original workbook with first ten or so data sets converted to tables along with the above added code. I already referenced the Microsoft PowerPoint Library which is something you may have forgotten to do when you added the code to your project.

    Have your PPT that you want to add slides to open then click the "Create PPT Slides" button. Additional formatted slides will be added with the tables embedded so you can actually work on them.

    HTH,
    Maud

    Your file with tables
    Ell1.png

    Fist table uploaded to silde
    Ell2.png

    PPT slides.xlsm

  10. #10
    Valued Forum Contributor Maudibe's Avatar
    Join Date
    12-21-2016
    Location
    USA
    MS-Off Ver
    2010-2013
    Posts
    326

    Re: To paste tables in editable form to specific slides of existing PowerPoint document

    Hi Maud,

    My superior actually wanted the slides to be in certain format. The presentation slides should be in this form: https://drive.google.com/open?id=0B4...VlOQ3Z1dmUtY1U

    Is it possible to make the code to do this?
    1. Detect the tables
    2. Prompt the user which tables (put numbers) they want to include to which slides (another prompt and has to put slide number)
    3. Using the presentation slide with this format (with the front page and the headers)
    4. Make the table editable in presentation slides, instead of Excel

    Your assistance is definitely appreciated. Thank you so much. Have a nice day.

    Ell.
    Hi Maud,

    Thank you for your assistance. If the second request is not there, would this still time consuming as I have to submit this by next week? Another question is, let say I would like to paste it in range but it comes out as a table form in PPT, is it still editable?
    Hi Ell,

    Attached is a revised version that will copy ranges of data instead of tables. You can indicate which sets of data to include on a slide by placing markers between them in col A. The marker is a "|" (pipe symbol). I placed them in Cells A13, A24, A35, A48, etc.. Theses will combine your data set and related commentary data on the same slide. Since the ranges are embedded, like the tables in my previous modded code, they are editable (in edit mode not presentation mode).PPT slides_Rev1.xlsm

    HTH,
    Maud

  11. #11
    Forum Contributor
    Join Date
    09-19-2017
    Location
    London
    MS-Off Ver
    2015
    Posts
    169

    Re: To paste tables in editable form to specific slides of existing PowerPoint document

    Quote Originally Posted by Maudibe View Post
    Hi Ell,

    Attached is a revised version that will copy ranges of data instead of tables. You can indicate which sets of data to include on a slide by placing markers between them in col A. The marker is a "|" (pipe symbol). I placed them in Cells A13, A24, A35, A48, etc.. Theses will combine your data set and related commentary data on the same slide. Since the ranges are embedded, like the tables in my previous modded code, they are editable (in edit mode not presentation mode).Attachment 541031


    HTH,
    Maud

    Hi Maud,

    Thank you so much for your alterations. But when I run the code, it says there's run time error 424: object required and when I debugged, it highlighted this line: activeSlide.Shapes.PasteSpecial(DataType:=ppPasteOLEObject).Select

    Not to mention, the error also created such condition that only the first 2 tables can be exported to PPT.

    May I know why? Your assistance is appreciated. Have a nice day.

    Update: I tried to copy the code and try to run it in my original Excel file but the only action that is done is activating blank PPT. May I know the reason as well?

    Thanks in advance.
    Last edited by ell_; 10-04-2017 at 09:22 AM.

  12. #12
    Forum Contributor
    Join Date
    09-19-2017
    Location
    London
    MS-Off Ver
    2015
    Posts
    169

    Re: To paste tables in editable form to specific slides of existing PowerPoint document

    Hi Maud, I tried your code the other day to new Excel file with only one table in one slide instead of 2 and I got this instead Capture.PNGCapture2.PNG

    May I know why? From what I read in the code, it supposed to read every range until there's a marker where it then pastes the specific slide to specific table. And only one slide can be generated instead of 2.

  13. #13
    Valued Forum Contributor Maudibe's Avatar
    Join Date
    12-21-2016
    Location
    USA
    MS-Off Ver
    2010-2013
    Posts
    326

    Re: To paste tables in editable form to specific slides of existing PowerPoint document

    Ell_,

    First, let me make sure that your data is set up in tables, correct?

    Only one table copied to one slide because you have only one pipe symbol ("|") after the first table. If you were to have added a second symbol after the second table then you would have ended up with two slides with one table on each.

    It appears that the slide created has included the data from column A only (cells A1 to A6) since the "Notes / commentary" within the merged cells is actually in Cell A1. The reason why this happened is because the code looks at the first line and grabs the last column used. The number of the last column is used to define the range to copy.

    In post #9, you can see a copy of your original sheet where the first line was a header using multiple columns. In your post above (post #12), your first line is now been changed to a merged notes / commentary where the last column across will evaluate to 1 so this is the reason why only one column was copied.

    Delete row one so the header Plants / Efficiency / Reliability is the first row then rerun the code. You should now see the three columns copied to the slide.

    HTH,
    Maud

  14. #14
    Forum Contributor
    Join Date
    09-19-2017
    Location
    London
    MS-Off Ver
    2015
    Posts
    169

    Re: To paste tables in editable form to specific slides of existing PowerPoint document

    Quote Originally Posted by Maudibe View Post
    Ell_,

    First, let me make sure that your data is set up in tables, correct?

    Only one table copied to one slide because you have only one pipe symbol ("|") after the first table. If you were to have added a second symbol after the second table then you would have ended up with two slides with one table on each.

    It appears that the slide created has included the data from column A only (cells A1 to A6) since the "Notes / commentary" within the merged cells is actually in Cell A1. The reason why this happened is because the code looks at the first line and grabs the last column used. The number of the last column is used to define the range to copy.

    In post #9, you can see a copy of your original sheet where the first line was a header using multiple columns. In your post above (post #12), your first line is now been changed to a merged notes / commentary where the last column across will evaluate to 1 so this is the reason why only one column was copied.

    Delete row one so the header Plants / Efficiency / Reliability is the first row then rerun the code. You should now see the three columns copied to the slide.

    HTH,
    Maud
    Alright thank you Maud.

+ 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. copy specific excel charts to a specific powerpoint slides
    By coolin in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-26-2019, 08:52 PM
  2. Replies: 8
    Last Post: 09-20-2017, 02:09 AM
  3. PowerPoint SLides Template
    By seotivist in forum Tips and Tutorials
    Replies: 2
    Last Post: 08-09-2016, 04:27 AM
  4. Copy data from Excel to PowerPoint slides/tables
    By RareNasturtium in forum Excel General
    Replies: 2
    Last Post: 06-07-2016, 02:22 PM
  5. 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
  6. add a specific slide to a powerpoint array of slides
    By aviben@bezeqint in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-31-2013, 07:27 AM
  7. Looping macro to paste Excel ranges to new Powerpoint slides
    By sammonite in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-06-2012, 05:18 AM

Tags for this Thread

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