If you want to add an image to the chart as background . Try this macro
Sub add_image_background()
Dim cht As Chart
Dim imgpath As String
imgpath = "C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\blue hills.jpg"
'change chart name here
Set cht = Sheets("Sheet1").ChartObjects("Chart 3").Chart
With cht.ChartArea
.Fill.UserPicture PictureFile:=imgpath
.Fill.Visible = True
End With
End Sub
Sub add_image_background()
Dim cht As Chart
Dim imgpath As String
imgpath = "C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\blue hills.jpg"
'change chart name here
Set cht = Sheets("Sheet1").ChartObjects("Chart 3").Chart
With cht.ChartArea
.Fill.UserPicture PictureFile:=imgpath
.Fill.Visible = True
End With
End Sub
No comments:
Post a Comment