I am trying to compress inserted .jpg files in a workbook. There is a button on the picture toolbar in Excel, but I would like to execute the command when the picture is inserted. However, "compress" does not seem to be a property for any event.

I have recorded a macro where I compress an image file, but it does not record the event - the code is blank!

I have the code in place to insert and resize the image, but I need to reduce the filesize; is it somehow possible

Re: Excel Inserted Image Files - Compress

Andy Pope


The compress method is not exposed via the Excel OM.

It is possible to use PowerPoint, via automation, to compress the image.
Or at a push, although I do not recommend, use SendKeys once the Compress dialog is displayed.