Dynamic background image in Excel?

I

icystorm

In Excel 2003, one can add a background picture to an Excel chart by
selecting...

Format plot area... Fill effects... Picture Tab... Selct Picture...

Is it possible to make the image (picture) acquisition a dynamic
process so that the image will refresh (update) each time Excel opens
or perhaps when a macro is run? The path and file name will be static,
but the image will be new each day.

If the solution is to construct a macro, I can do that, but I was
curious if there is a better way to address this.

Any thoughts?

Thanks!

Cheers,
J
 
L

Luke M

You are correct, it will require a macro. You can make it so that the picture
is changed when you open the workbook, you can do the following. Open up the
VBE by right-clicking on the sheet tab, view code. In the project navigation
window (if not visible, check under View) navigate to the ThisWorkbook
module. Paste this in, and edit the appropriate lines:

'============
Private Sub Workbook_Open()
'Tell the macro which sheet to work with
Sheets("Sheet1").ChartObjects("Chart 1").Activate
With ActiveChart.PlotArea

'Which picture file to use?
.Fill.UserPicture PictureFile:= _
"C:\My Documents\My Pictures\My picture.bmp"
.Fill.Visible = True
End With
End Sub
'=============
 
I

icystorm

You are correct, it will require a macro. You can make it so that the picture
is changed when you open the workbook, you can do the following. Open up the
VBE by right-clicking on the sheet tab, view code. In the project navigation
window (if not visible, check under View) navigate to the ThisWorkbook
module. Paste this in, and edit the appropriate lines:

'============
Private Sub Workbook_Open()
    'Tell the macro which sheet to work with
    Sheets("Sheet1").ChartObjects("Chart 1").Activate
    With ActiveChart.PlotArea

    'Which picture file to use?
    .Fill.UserPicture PictureFile:= _
        "C:\My Documents\My Pictures\My picture.bmp"
    .Fill.Visible = True
    End With
End Sub
'=============

--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*

Thank you, Luke.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top