HI Smitty,
You can use the method described in my earlier reply to Joe William.
Assume that 'cow#1', 'cow#2' etc are in cell A1 of each sheet.
Assume cell A2 contains the path for each picture.
This code will create a blank chart on each sheet in a workbook, and
import a picture into the chart based on the contents of cell A1 and A2.
The pictures are not linked, so it is safe to send the resulting workbook
to a client.
The code has been modified slightly to make it more generic. You need
to run the macro 'SetPicsForAllSheets' once to set the pictures for
all worksheets.
Sub SetPicsForAllSheets()
Dim sh As Worksheet
Dim strPic As String
Dim strPth As String
Dim strExt As String
For Each sh In ActiveWorkbook.Worksheets
strPic = sh.Range("A1") ' name of picture to import e.g. cow#1
strPth = sh.Range("A2") ' path of picture e.g. C:\My Documents\
strExt = sh.Range("A3") ' file extension for picture e.g. .jpg, .gif
Call BuildChartPic(sh.Name, strPic, strPth, strExt)
Next sh
End Sub
Sub BuildChartPic(strSht As String, strPic As String, strPth As String,
strExt As String)
Dim ch As ChartObject
' build full path and file name
strPic = strPth & strPic & strExt
Set ch = Worksheets(strSht).ChartObjects.Add(100, 30, 400, 250)
ch.Activate
ActiveChart.ChartArea.Fill.UserPicture PictureFile:=strPic
End Sub
Ed Ferrero
http://edferrero.m6.net
> Oddly enough I was going to just post a question about bringing in a new
> picture depending on what doc I was in, and lo-n-behold, the answer may be
[quoted text clipped - 21 lines]
>
> Excel 2002