#1   Report Post  
Joe William
 
Posts: n/a
Default updating photo



I have a master document of construction data that updates itself
whenever I put a number like "124" in d5 (field)

I want to add a picture from a folder of digital images that are named
sequentially like: dsc00124.jpg

I want to see the picture on the same page as the master document

I would like a way to get the picture to update corresponding to the
number I insert in the field, also I have to handle the leading zeros
and the fact that I'll have thousands of pictures

Thanks a lot
  #2   Report Post  
Ed Ferrero
 
Posts: n/a
Default

Hi Joe,

You need some sort of container to hold the picture. Let's say we use
an embedded chart as a container. Just Insert - Chart and click Finish
to insert a blank chart in a worksheet. Hold the shift key down and
click on the chart to see the name of the embedded chart (it should
be "Chart 1".

Then run this macro. Change strPath to suit your situation.
Note that we could do the same thing using a shape to hold the
picture, but a chart object can be much more useful.


Sub UpdateChartPic()

Dim strPic As String
Dim strPath As String

strPath = "C:\Documents and Settings\Ed\My Documents\My Pictures\dsc00"

strPic = Range("D5")
strPic = strPath & strPic & ".jpg"

ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.ChartArea.Fill.UserPicture PictureFile:=strPic

End Sub

Ed Ferrero
http://edferrero.m6.net




I have a master document of construction data that updates itself
whenever I put a number like "124" in d5 (field)

I want to add a picture from a folder of digital images that are named
sequentially like: dsc00124.jpg

I want to see the picture on the same page as the master document

I would like a way to get the picture to update corresponding to the
number I insert in the field, also I have to handle the leading zeros
and the fact that I'll have thousands of pictures

Thanks a lot



  #3   Report Post  
Joe William
 
Posts: n/a
Default


Wow thanks, friend. I'll start working on it. Can it run automatically
whenever a certain field has a number put in it? And can the number be
pasted into the formula you gave me automatically, changing for each
different user inputted number?



In article , Ed Ferrero
wrote:

Hi Joe,

You need some sort of container to hold the picture. Let's say we use
an embedded chart as a container. Just Insert - Chart and click Finish
to insert a blank chart in a worksheet. Hold the shift key down and
click on the chart to see the name of the embedded chart (it should
be "Chart 1".

Then run this macro. Change strPath to suit your situation.
Note that we could do the same thing using a shape to hold the
picture, but a chart object can be much more useful.


Sub UpdateChartPic()

Dim strPic As String
Dim strPath As String

strPath = "C:\Documents and Settings\Ed\My Documents\My Pictures\dsc00"

strPic = Range("D5")
strPic = strPath & strPic & ".jpg"

ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.ChartArea.Fill.UserPicture PictureFile:=strPic

End Sub

Ed Ferrero
http://edferrero.m6.net




I have a master document of construction data that updates itself
whenever I put a number like "124" in d5 (field)

I want to add a picture from a folder of digital images that are named
sequentially like: dsc00124.jpg

I want to see the picture on the same page as the master document

I would like a way to get the picture to update corresponding to the
number I insert in the field, also I have to handle the leading zeros
and the fact that I'll have thousands of pictures

Thanks a lot



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I link a cell to an external photo? graphicsjunky New Users to Excel 3 June 15th 05 03:59 PM
Updating multiple worksheets in a large workbook Graham Excel Discussion (Misc queries) 3 February 11th 05 11:29 AM
When updating a worksheet, how do I create a link updating the sa. Phlashh Excel Worksheet Functions 9 January 27th 05 07:05 PM
duplicating formulas without updating Wazooli Excel Worksheet Functions 3 December 16th 04 05:27 PM
Formula not updating Paul Excel Worksheet Functions 2 November 6th 04 02:05 AM


All times are GMT +1. The time now is 04:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"