Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Links / July 2005

Tip: Looking for answers? Try searching our database.

updating photo

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Joe William - 28 Jul 2005 03:39 GMT
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
Ed Ferrero - 28 Jul 2005 13:06 GMT
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)
[quoted text clipped - 9 lines]
>
> Thanks a lot
Joe William - 30 Jul 2005 01:37 GMT
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?

> Hi Joe,
>
[quoted text clipped - 39 lines]
> >
> > Thanks a lot
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.