+ Reply to Thread
Results 1 to 8 of 8

Macro to reduce image sizes in a ppt that worked in ppt 2007 but not in ppt 2013

  1. #1
    Registered User
    Join Date
    03-01-2012
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2010
    Posts
    60

    Macro to reduce image sizes in a ppt that worked in ppt 2007 but not in ppt 2013

    Hi,

    I've a macro that I used with some ppt's in office 2007 to reduce the size of some links within the ppt to an excel file. Recently I've installed the Office 2013 and the macro crashed with the following error:

    Please Login or Register  to view this content.
    Here is the code I have:

    Please Login or Register  to view this content.
    I believe now, I've to activate each shape in every slide but I don't know how to do it. I've tried to use an integer to point to each slide but I had no success.
    Can someone help me?!

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro to reduce image sizes in a ppt that worked in ppt 2007 but not in ppt 2013

    Maybe you don't need the select, try just commenting it out.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    03-01-2012
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2010
    Posts
    60

    Re: Macro to reduce image sizes in a ppt that worked in ppt 2007 but not in ppt 2013

    Quote Originally Posted by xladept View Post
    Maybe you don't need the select, try just commenting it out.
    Doing that, the error went to the paste data type. It gave me this:

    Please Login or Register  to view this content.
    ???

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro to reduce image sizes in a ppt that worked in ppt 2007 but not in ppt 2013

    Hi Adam,

    I have no idea - I'll present this thread to the community at large

  5. #5
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,572

    Re: Macro to reduce image sizes in a ppt that worked in ppt 2007 but not in ppt 2013

    • You do not need to select the slide
    • You are using oSh as a For..Next control variable; but then, inside the loop you are pointing it to two other shapes. You need to use a separate variable for that:
      Set oSh = curr_slide.Shapes(3) ... ---->....Set curr_shp = curr_slide.Shapes(3), etc.
    • I don't think you can use .PasteSpecial with the .Cut. Instead, maybe Copy, PasteSpecial, Cut curr_shp.Shapes(3) .... [What happens if there is no third shape?]

    I'm not sure about using SET with PasteSpecial
    Last edited by protonLeah; 09-26-2015 at 02:31 AM.
    Ben Van Johnson

  6. #6
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Macro to reduce image sizes in a ppt that worked in ppt 2007 but not in ppt 2013

    Please Login or Register  to view this content.



  7. #7
    Registered User
    Join Date
    03-01-2012
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2010
    Posts
    60

    Re: Macro to reduce image sizes in a ppt that worked in ppt 2007 but not in ppt 2013

    Quote Originally Posted by protonLeah View Post
    • You do not need to select the slide
    • You are using oSh as a For..Next control variable; but then, inside the loop you are pointing it to two other shapes. You need to use a separate variable for that:
      Set oSh = curr_slide.Shapes(3) ... ---->....Set curr_shp = curr_slide.Shapes(3), etc.
    • I don't think you can use .PasteSpecial with the .Cut. Instead, maybe Copy, PasteSpecial, Cut curr_shp.Shapes(3) .... [What happens if there is no third shape?]

    I'm not sure about using SET with PasteSpecial
    I commented out the select and it gave me the error related with the data type. I tried to use a separate variable for the shapes inside the loop but it also still gives me the data type error. Cut or copy also give the same result. There was no problem with the datatype in Office 2007 =\

    tks for the help!

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    03-01-2012
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2010
    Posts
    60

    Re: Macro to reduce image sizes in a ppt that worked in ppt 2007 but not in ppt 2013

    Hi

    I've solved the problem, basically by defining my datatype with the associated ID number instead of indicating the traditional "ppPasteXPTO". I've also used the number of the Bitmap format file instead of the PNG since it allows me to reduce the size of the ppt but it's not so heavy in the image compression like the PNG is. Here is the final code:

    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. VBA formatting macro that worked in Excel 2010 is not working correctly in Excel 2013
    By jayar2112 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-10-2015, 01:14 PM
  2. Replies: 1
    Last Post: 06-08-2015, 03:15 PM
  3. Replies: 0
    Last Post: 06-08-2015, 03:07 PM
  4. [SOLVED] VB Macro to Auto Insert Two Checkboxes For Each Image in Excel 2007 Workbook
    By jcook1100 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 10-21-2014, 10:22 AM
  5. Replies: 7
    Last Post: 09-12-2013, 03:01 AM
  6. Charting Macro worked in 2003 but not in 2007
    By paulabrozek in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 09-01-2009, 02:28 PM
  7. Reduce image size before inserting.
    By Jay59 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-03-2007, 04:13 PM

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