Originally Posted by
nomad
I am trying to use macro to set the chart fill with specified picture. The pictures are processed and located in the same excel sheet.
Is there anyway to do this?
Beginner on Macro. Thanks very much.
Hello:
I got this code below when I recorded a macro while filling the chart area with a userpic of Paris Hotel
The chart was embedded in the sheet.
Its basically performing a Format Chart Area......fill. (note that this different to plot area) The picture will go behind the plot area. ie around the edge of the plot area
here is the code:
Hope this helps
Alan Swinburne
Code:
Sub Macro1()
'
' Macro1 Macro
'
ActiveSheet.ChartObjects("Chart 1").Activate
With ActiveSheet.Shapes("Chart 1").Fill
.Visible = msoTrue
.PresetTextured msoTexturePapyrus
.TextureTile = msoTrue
.TextureOffsetX = 0
.TextureOffsetY = 0
.TextureHorizontalScale = 1
.TextureVerticalScale = 1
.TextureAlignment = msoTextureTopLeft
End With
With ActiveSheet.Shapes("Chart 1").Fill
.Visible = msoTrue
.UserPicture "C:\Users\Alans\Pictures\paris hotel.jpg"
.TextureTile = msoFalse
End With
End Sub
Bookmarks