+ Reply to Thread
Results 1 to 3 of 3

Powerpoint slide shape deletion

  1. #1
    Registered User
    Join Date
    06-24-2005
    Posts
    45

    Powerpoint slide shape deletion

    Hi,
    I am trying to write a macro which enable me to delete all graphs from the existing powerpoint and paste new set of graphs for monthly presentation.

    I could get most of the macro codes from this site and Iam very happy to acknowledge the same. However I am not able to delete all the graph from the slides- I have to loop thru around 50 slides and need to delete all the graphs. I have written macro which deletes almost all graphs from the slides. However the macro does not deleting some of the graphs from the slides. Though all graphs pasted like picture and I am not able to find out the reason it skips some of the graphs. I tried all possible way and coul dnot succeed.

    I am giving my Macro below and the one PPT slide -

    In this case one graph gets deleted and another one is not. Total shapes count(ShapesCnt) is showing 4 and it coming out of loop after deleting 3rd shape (one graph) - The loop does not gets executed for 4th shape which is the second graph. I'm not sure why the it is coming out of loop after 3rd.
    Please Login or Register  to view this content.
    Any help in this regard would be highly appreciated. Thanks in advance.

    Joe
    Attached Files Attached Files
    Last edited by VBA Noob; 03-06-2009 at 01:58 PM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Powerpoint slide shape deletion-help

    The looping get confused when you delete references within the loop.

    Use a normal FOR NEXT loop working backwards through the shapes collection

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    06-24-2005
    Posts
    45

    Re: Powerpoint slide shape deletion-help

    That's really Great !!! It worked !!!! Thanks you very much !

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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