Results 1 to 2 of 2

Thread: Excel 2013 - Picture Compression Macro

  1. #1
    Junior Member
    Join Date
    Jul 2013
    Posts
    1
    Rep Power
    0

    Excel 2013 - Picture Compression Macro

    I have searched for a way to program a macro to automate picture compression, and have found numerous options listed online. The only problem is that none of them seem to work for Excel 2013.
    I received a last-minute upgrade to Office (2010 to 2013), and now some of my macros no longer work.

    Below are come code examples that I have found online and tried.

    Examples:


    Code:
    Dim octl As CommandBarControl
        Set octl = Application.CommandBars.FindControl(ID:=6382)
            Application.SendKeys "%e~~"
        octl.Execute
    This seems to work fine for older versions of Office (pre 2007)

    __________________________________________________ __________________

    Code:
    Application.SendKeys "%(oe)~{TAB}~"
        Application.CommandBars.ExecuteMso "PicturesCompress"
    This seems to work for Office 2007 & 2010

    __________________________________________________ __________________

    These are options that I have tried for 2013, and have had no success so far...

    Code:
    If Application.Version >= 14 Then
        'Application.SendKeys "a", True
        'Application.SendKeys "s", True
        'Application.SendKeys "{Enter}", True
        'Application.CommandBars.ExecuteMso "PicturesCompress"
        
        'Pic.Activate
        'SendKeys "%JP", True
        'SendKeys "%m", True
        'SendKeys "ae", True
        'SendKeys "Enter", True
    
    
        Dim octl As CommandBarControl
        Set octl = Application.CommandBars.FindControl(ID:=6382)
            Application.SendKeys "%e~"
            Application.SendKeys "%a~"
        octl.Execute
    
    End If
    __________________________________________________ ____________________


    I can use Application.CommandBars.ExecuteMso "PicturesCompress" in order to open the dialog box, but sendkeys don't seem to have focus on the pop-up window.
    I would prefer to not leave the choices up to the end-user if at all possible.


    Any help would be greatly appreciated.

    Edit: Please use code tags when posting codes. This time I added for you.
    Last edited by Admin; 07-09-2013 at 09:35 AM.

  2. #2
    Member
    Join Date
    May 2013
    Posts
    31
    Rep Power
    0
    Did you disable UAC?

Similar Threads

  1. Replies: 4
    Last Post: 06-09-2013, 01:43 AM
  2. How To Use Camera Control In Excel To Paste Picture As Link
    By Transformer in forum Tips, Tricks & Downloads (No Questions)
    Replies: 0
    Last Post: 05-27-2013, 10:42 PM
  3. Good tutorial Excel 2013 SDK
    By Rasm in forum Excel Help
    Replies: 2
    Last Post: 04-01-2013, 01:17 AM
  4. Copy and Past as picture/bitmap in email body form excel.
    By Rajesh Kr Joshi in forum Excel Help
    Replies: 0
    Last Post: 12-05-2012, 09:56 PM
  5. Saving Embedded Picture From Excel Workbook Sheet To Folder Hard Drive
    By littleiitin in forum Excel and VBA Tips and Tricks
    Replies: 0
    Last Post: 10-31-2011, 02:31 PM

Posting Permissions

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