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

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
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: 50
  • Execute_Error_(Calling_Word_App).png
    Execute_Error_(Calling_Word_App).png
    13.9 KB · Views: 50
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: 39
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: 72
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,223,669
Messages
6,173,702
Members
452,527
Latest member
ineedexcelhelptoday

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