Consulting

Results 1 to 5 of 5

Thread: Multiple Charts To Multiple Slides

  1. #1
    VBAX Newbie
    Joined
    Jun 2008
    Posts
    3
    Location

    Multiple Charts To Multiple Slides

    Every month I need to create a large report that requires pasting multiple excel charts into multiple slides in PowerPoint. I have an Excel workbook with 25 charts in one worksheet and I need to update an existing presentation with these graphs.

    So what I need to do is:
    1. Open an existing presentation and clear the graphs that exist on the slides
    2. Copy the charts in the worksheet one by one and paste them on designated slides in the presentation

    Please note:
    1. All the 25 charts will have to be pasted in different slides
    2. It is not the case that chart1 goes to slide1 and chart25 goes to slide25...there is no such order. It is like, chart1 to slide 3, chart2 to slide7, chart3 to slide8 and so on. So, I will need to guide which chart is pasted on which slide.
    3. The new charts will have to be in the same position as the previous charts on the slides.
    4. Most of the slides have one chart only but one slide has two charts.

    Can you please tell me how this can be automated using Excel VBA? I really need this urgently so any help is appreciated.Thanks a lot!

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    I have a lot of code that does stuff similar to this, but it is all based upon a single slide PPT template. I would suggest you use the same.

    After that, it is just a metter of somehow tagging the charts, and processing them in order (sort the tags?).
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Newbie
    Joined
    Jun 2008
    Posts
    3
    Location

    Multiple Charts To Multiple Slides

    XLD...thanks for the quick reply.

    I have written a code that takes one chart and pastes it to a slide that I designate. Where I am facing a problem is:
    1. How do I create a reference for each chart and map it to every slide number (basically which chart goes to which slide)
    2. How do I pass this entire operation in a loop so that it runs for all charts?
    Any help will be great!

    Thanks!

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Do a number of things.

    - name the charts logically, say Input_Chart, Market_Chart,a nd so on, not using the defaults

    - create a list of names in one column, PPT order in the next

    - sort this list by PPT order, loop thorugh this list and retrieve the next named chart by name, add a new slide to the PPT presentation, and copy the chart over.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    VBAX Newbie
    Joined
    Jun 2008
    Posts
    3
    Location

    Multiple Charts To Multiple Slides

    Thanks!

    I have created the chart names and their corresponding slide destination. But I am not sure about the VBA code to do the looping. Is there any existing code that I can use for this?

    Thanks a lot!

Posting Permissions

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