Request: Macro to compress Pictures (PPI) | Application.CommandBars.FindControl(ID:=6382) | Excel

DrHacker

New Member
Joined
Jun 4, 2018
Messages
33
After hours of search, I decide to come with the experts and ask you!

I need a Macro that Compress (PPI's / DPI's Not Dimensions) for All Excel Pictures at all the workbook.

As far as I know, the ID code for that is 6382. But I can’t find a way to program it and work.

As well, it needs to work at different versions of Office (x86 / x64) 2013, 2016 & 365 (all variants) if posible

There is some one that did the trick already and can share? :unsure:
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Unfortunatelly doesnt work, I tried yours and add Word Module as part of the code but same result.

Execute mark in Yellow, any suggestion?

(Share Code - Your support Help code)

(New - Adding Word Module)
 

Attachments

  • Execute_Error_(Share_Code).png
    Execute_Error_(Share_Code).png
    7.3 KB · Views: 46
  • Execute_Error_(Calling_Word_App).png
    Execute_Error_(Calling_Word_App).png
    13.9 KB · Views: 46
Upvote 0
So can you describe in a bit more detail what you did, what happened and what you expected to happen? (How do you run your code, just pressing F5 or step-by-step? How do you test if pictures have been shrunk, etc.)
Cheers,
Koen
 
Upvote 0
So can you describe in a bit more detail what you did, what happened and what you expected to happen? (How do you run your code, just pressing F5 or step-by-step? How do you test if pictures have been shrunk, etc.)
Cheers,
Koen

Using step by step (F8) i got an error code (Attached)

I try running with F5 and / or with macro panel and same yellow mark.
 

Attachments

  • Untitled2.png
    Untitled2.png
    3.9 KB · Views: 35
Upvote 0
Using step by step (F8) i got an error code (Attached)

I try running with F5 and / or with macro panel and same yellow mark.
As well, this are the references that im using as part of VBA code (image)
 

Attachments

  • References.png
    References.png
    19.4 KB · Views: 67
Upvote 0
Thanks guys!

I can do it changing the code and addint a sleep before sendkeys.

here is the solution

VBA Code:
        Application.CommandBars.ExecuteMso "PicturesCompress"
                        
        Sleep 500
        SendKeys "%A%W{Enter}"
 
Upvote 0
Can this work in Word? I know this is an Excel Forum... I have Office 365. I don't know if this is impossible, or I am doing something wrong. Need for work and a suite of Macros I am finalising.
 
Upvote 0

Forum statistics

Threads
1,214,965
Messages
6,122,496
Members
449,089
Latest member
Raviguru

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top