PC Review


Reply
Thread Tools Rate Thread

How to Compress Pictures using VBA

 
 
Jack
Guest
Posts: n/a
 
      8th Apr 2008
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!
--
Jack
<><>
 
Reply With Quote
 
 
 
 
Bernie Deitrick
Guest
Posts: n/a
 
      8th Apr 2008
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


"Jack" <n2(delete)(E-Mail Removed)> wrote in message
news:2B815370-1E2F-42BF-A107-(E-Mail Removed)...
> 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!
> --
> Jack
> <><>



 
Reply With Quote
 
Jack
Guest
Posts: n/a
 
      8th Apr 2008
Thanks!
--
Jack Waller
<><>


"Bernie Deitrick" wrote:

> 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
>
>
> "Jack" <n2(delete)(E-Mail Removed)> wrote in message
> news:2B815370-1E2F-42BF-A107-(E-Mail Removed)...
> > 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!
> > --
> > Jack
> > <><>

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
compress pictures Dim Microsoft Outlook Discussion 5 10th Sep 2009 01:47 PM
Compress Pictures with VBA Micha Microsoft Excel Programming 3 26th Sep 2006 10:47 AM
Excel's Compress Pictures or deleting pictures doesn't seem work =?Utf-8?B?Z3VpZG9k?= Microsoft Excel Misc 1 29th Jan 2006 06:51 AM
Compress pictures Peter Huber Microsoft Powerpoint 3 2nd Sep 2004 08:19 AM
Compress Pictures Gummo Microsoft Powerpoint 6 12th Sep 2003 08:01 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:31 PM.