Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Image recolor with VBA

Hi all,

does anybody know what's the VBA method to obtain the same effect of
recoloring a bitmap inserted on a worksheet ? if you place a picture
on a sheet with Insert | Picture, then right click on it and select
Picture format | Picture | Recolor (select anyone) the picure is
recolored applying a transparent layer of the selected color on it.
How to obtain the same effect with VBA ? I cannot find the right
method.
thanks in advance
Nik

PS : I'am using XL2007 in Italian, command translations could be
slightly different, sorry
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Image recolor with VBA

Nik explained :
Hi all,

does anybody know what's the VBA method to obtain the same effect of
recoloring a bitmap inserted on a worksheet ? if you place a picture
on a sheet with Insert | Picture, then right click on it and select
Picture format | Picture | Recolor (select anyone) the picure is
recolored applying a transparent layer of the selected color on it.
How to obtain the same effect with VBA ? I cannot find the right
method.
thanks in advance
Nik

PS : I'am using XL2007 in Italian, command translations could be
slightly different, sorry


Did you try using the macro recorder?

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 230
Default Image recolor with VBA

On 06/05/2011 23:09, GS wrote:
Nik explained :
Hi all,

does anybody know what's the VBA method to obtain the same effect of
recoloring a bitmap inserted on a worksheet ? if you place a picture
on a sheet with Insert | Picture, then right click on it and select
Picture format | Picture | Recolor (select anyone) the picure is
recolored applying a transparent layer of the selected color on it.
How to obtain the same effect with VBA ? I cannot find the right
method.
thanks in advance
Nik

PS : I'am using XL2007 in Italian, command translations could be
slightly different, sorry


Did you try using the macro recorder?


On XL2007 ? You have to be kidding. It is complete junk on that version.

If you are *very* lucky it might at best produce something that is
syntactically valid called Macro1() but doesn't work and at worst it
will crash at runtime in a hopeless mess.

I'd hazard a guess it is something in or near .ShapeRange.Fill but it
may require some trial and error on your part to find it and make it
behave as you would like. Don't expect any help from the help system :(

Regards,
Martin Brown

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Image recolor with VBA

Martin Brown used his keyboard to write :
On 06/05/2011 23:09, GS wrote:
Nik explained :
Hi all,

does anybody know what's the VBA method to obtain the same effect of
recoloring a bitmap inserted on a worksheet ? if you place a picture
on a sheet with Insert | Picture, then right click on it and select
Picture format | Picture | Recolor (select anyone) the picure is
recolored applying a transparent layer of the selected color on it.
How to obtain the same effect with VBA ? I cannot find the right
method.
thanks in advance
Nik

PS : I'am using XL2007 in Italian, command translations could be
slightly different, sorry


Did you try using the macro recorder?


On XL2007 ? You have to be kidding. It is complete junk on that version.

If you are *very* lucky it might at best produce something that is
syntactically valid called Macro1() but doesn't work and at worst it will
crash at runtime in a hopeless mess.

I'd hazard a guess it is something in or near .ShapeRange.Fill but it may
require some trial and error on your part to find it and make it behave as
you would like. Don't expect any help from the help system :(

Regards,
Martin Brown


Well stated!
I'd probably use an earlier version and record manual steps just to get
the right object refs, then rewrite into something more formidable.<g

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Image recolor with VBA

I did try to use the 2007 macro recorder, nothing gets recorded
unfortunately. I also tried 2003 but that method wasn't available at
that time.Thanks for suggesting. ShapeRange.Fill, I'll try that too.
Nik


On Fri, 06 May 2011 22:03:49 GMT, (Nik)
wrote:

Hi all,

does anybody know what's the VBA method to obtain the same effect of
recoloring a bitmap inserted on a worksheet ? if you place a picture
on a sheet with Insert | Picture, then right click on it and select
Picture format | Picture | Recolor (select anyone) the picure is
recolored applying a transparent layer of the selected color on it.
How to obtain the same effect with VBA ? I cannot find the right
method.
thanks in advance
Nik

PS : I'am using XL2007 in Italian, command translations could be
slightly different, sorry




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 587
Default Image recolor with VBA

hi Nik and All,

the following code works on XL2002, i hope it will work for xl2007

Sub Macro1()
With Worksheets(1).Shapes("Picture 1").Fill
.Visible = True
.BackColor.RGB = RGB(170, 170, 170)
.Transparency = 0.99
End With
End Sub



--
isabelle

Le 2011-05-08 15:23, Nik a écrit :
I did try to use the 2007 macro recorder, nothing gets recorded
unfortunately. I also tried 2003 but that method wasn't available at
that time.Thanks for suggesting. ShapeRange.Fill, I'll try that too.
Nik


On Fri, 06 May 2011 22:03:49 GMT, (Nik)
wrote:

Hi all,

does anybody know what's the VBA method to obtain the same effect of
recoloring a bitmap inserted on a worksheet ? if you place a picture
on a sheet with Insert | Picture, then right click on it and select
Picture format | Picture | Recolor (select anyone) the picure is
recolored applying a transparent layer of the selected color on it.
How to obtain the same effect with VBA ? I cannot find the right
method.
thanks in advance
Nik

PS : I'am using XL2007 in Italian, command translations could be
slightly different, sorry


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Image recolor with VBA

Thank you Isabelle,

Your code seems formally correct, no errors in macro, but when run
nothing happens.
Nik


On Sun, 08 May 2011 21:47:07 -0400, isabelle wrote:

hi Nik and All,

the following code works on XL2002, i hope it will work for xl2007

Sub Macro1()
With Worksheets(1).Shapes("Picture 1").Fill
.Visible = True
.BackColor.RGB = RGB(170, 170, 170)
.Transparency = 0.99
End With
End Sub



--
isabelle

Le 2011-05-08 15:23, Nik a écrit :
I did try to use the 2007 macro recorder, nothing gets recorded
unfortunately. I also tried 2003 but that method wasn't available at
that time.Thanks for suggesting. ShapeRange.Fill, I'll try that too.
Nik


On Fri, 06 May 2011 22:03:49 GMT, (Nik)
wrote:

Hi all,

does anybody know what's the VBA method to obtain the same effect of
recoloring a bitmap inserted on a worksheet ? if you place a picture
on a sheet with Insert | Picture, then right click on it and select
Picture format | Picture | Recolor (select anyone) the picure is
recolored applying a transparent layer of the selected color on it.
How to obtain the same effect with VBA ? I cannot find the right
method.
thanks in advance
Nik

PS : I'am using XL2007 in Italian, command translations could be
slightly different, sorry



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Image recolor with VBA

On Friday, May 6, 2011 5:03:49 PM UTC-5, Nik wrote:
Hi all,

does anybody know what's the VBA method to obtain the same effect of
recoloring a bitmap inserted on a worksheet ? if you place a picture
on a sheet with Insert | Picture, then right click on it and select
Picture format | Picture | Recolor (select anyone) the picure is
recolored applying a transparent layer of the selected color on it.
How to obtain the same effect with VBA ? I cannot find the right
method.
thanks in advance
Nik

PS : I'am using XL2007 in Italian, command translations could be
slightly different, sorry


Really late to this convo, but in case anyone stumbles across this....

For whatever reason, Microsoft hasn't 'exposed' the recolor method in Excel/PowerPoint. You can do it manually using the ribbon, but not via VBA. The method is exposed in Publisher.

http://msdn.microsoft.com/en-us/libr...ffice.15).aspx
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
recolor cell upon entry Electric Julie[_2_] Excel Worksheet Functions 1 October 16th 08 01:06 AM
Andy Pope's button image editor; pasting icons to sheet then toolbar- why does image quality degrade? ker_01 Excel Programming 1 July 28th 08 01:57 PM
Is there any way to search image of my local drive with Image name or Image Title, Description [email protected] Excel Programming 3 August 3rd 07 01:44 PM
VBA to display image on a form - image is defined in Range Name Tan Excel Programming 4 May 17th 06 03:37 PM
Recolor Cell based on Sum of Zero Cloudburst99 Excel Worksheet Functions 1 February 11th 05 03:05 PM


All times are GMT +1. The time now is 04:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"