How to Compress Pictures using VBA

J

Jack

I'd like to add the compression of pictures to a Workbook application using
VBA. I believe I've found that this functionality is not directly exposed to
VBA. I have found that I can bring up a Compress Picture dialog in the Click
event of a command button by invoking:

CommandBars.FindControl(ID:=6382).Execute

However, this does NOT compress my pictures. If I manually select the
picture(s) and select the Compress Picture button and compress, the pictures
do compress.

The worksheet containing the pictures is usally protected. I have added code
around the Compress Picture code to unprotect the worksheet and protect it
after compression. No affect.

I'm developing in Excel 2007 but saving the document in the Excel 98-2003
format.

Has anyone successfully compressed pictures using VBA or have any
tips/suggestions?

Thanks!
 
B

Bernie Deitrick

Jack,

AFAIK, you cannot from within Excel. There may be an application that can be used as a reference
that allows you to do so, but it is not native to Excel.

HTH,
Bernie
MS Excel MVP
 
J

Jack

Thanks!
--
Jack Waller
<><>


Bernie Deitrick said:
Jack,

AFAIK, you cannot from within Excel. There may be an application that can be used as a reference
that allows you to do so, but it is not native to Excel.

HTH,
Bernie
MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top