Skip to content

Latest commit

 

History

History
52 lines (33 loc) · 1.74 KB

Excel.PictureFormat.TransparencyColor.md

File metadata and controls

52 lines (33 loc) · 1.74 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
PictureFormat.TransparencyColor property (Excel)
vbaxl10.chm113009
vbaxl10.chm113009
Excel.PictureFormat.TransparencyColor
c3a7a247-0cc2-adc8-e13f-a1f4ff728ba0
05/03/2019
medium

PictureFormat.TransparencyColor property (Excel)

Returns or sets the transparent color for the specified picture as a red-green-blue (RGB) value. For this property to take effect, the TransparentBackground property must be set to True. Applies to bitmaps only. Read/write Long.

Syntax

expression.TransparencyColor

expression A variable that represents a PictureFormat object.

Remarks

If you want to be able to see through the transparent parts of the picture all the way to the objects behind the picture, you must set the Visible property of the picture's FillFormat object to False.

If your picture has a transparent color and the Visible property of the picture's FillFormat object is set to True, the picture's fill will be visible through the transparent color, but objects behind the picture will be obscured.

Example

This example sets the color that has the RGB value returned by the function RGB(0, 0, 255) as the transparent color for shape one on myDocument. For the example to work, shape one must be a bitmap.

blueScreen = RGB(0, 0, 255) 
Set myDocument = Worksheets(1) 
With myDocument.Shapes(1) 
 With .PictureFormat 
 .TransparentBackground = True 
 .TransparencyColor = blueScreen 
 End With 
 .Fill.Visible = False 
End With

[!includeSupport and feedback]