Inserting a photo from a directory

S

Stevep4

What would I need to do to get a picture to automatically insert into a cell?

In a separate cell, the filename will appear (such as HP97).

I want something like


=INDIRECT.EXT("'G:\shared\data\["&L22&".jpg]")

where cell L22 would provide the detail such as HP97

The remote directory will have hundreds of jpg files, so I cannot consider
the McGimpsey solution which requires the photos to be hidden in the excel
document.

Following the insert of the picture. I would prefer that the picture is
scaled to fit, but if this is not possible, I can scale the original pictures
myself before saving them into the directory.
 
S

Stevep4

I guess that your code is in French language which needs translating into
Excel 2000 english.

Firstly, lets try to simplify things. Lets start with inserting a photo from
my local hard drive. Would this code work??

Sub TestInsertPicture()
insertPicture "C:\photo.jpg",
Range (a2)
End Sub



JB said:
Sub ImportPicture()
repertoire = "G:\shared\data\"
[M22].Select
ActiveSheet.Pictures.Delete
Set monimage = ActiveSheet.Pictures.Insert(repertoire & [L22] &
".jpg")
Selection.RowHeight = monimage.Height
End Sub

JB
http://boisgontierjacques.free.fr

What would I need to do to get a picture to automatically insert into a cell?

In a separate cell, the filename will appear (such as HP97).

I want something like

=INDIRECT.EXT("'G:\shared\data\["&L22&".jpg]")

where cell L22 would provide the detail such as HP97

The remote directory will have hundreds of jpg files, so I cannot consider
the McGimpsey solution which requires the photos to be hidden in the excel
document.

Following the insert of the picture. I would prefer that the picture is
scaled to fit, but if this is not possible, I can scale the original pictures
myself before saving them into the directory.
 
J

JB

Sub TestInsertPicture()
[B2].Select
ActiveSheet.Pictures.Insert ( "c:\photo.jpg")
End Sub

JB

I guess that your code is in French language which needs translating into
Excel 2000 english.

Firstly, lets try to simplify things. Lets start with inserting a photo from
my local hard drive.  Would this code work??

Sub TestInsertPicture()
insertPicture "C:\photo.jpg",
Range (a2)
End Sub



JB said:
Sub ImportPicture()
  repertoire = "G:\shared\data\"
  [M22].Select
  ActiveSheet.Pictures.Delete
  Set monimage = ActiveSheet.Pictures.Insert(repertoire & [L22] &
".jpg")
  Selection.RowHeight = monimage.Height
End Sub

What would I need to do to get a picture to automatically insert intoa cell?
In a separate cell, the filename will appear (such as HP97).
I want something like
=INDIRECT.EXT("'G:\shared\data\["&L22&".jpg]")
where cell L22 would provide the detail such as HP97
The remote directory will have hundreds of jpg files, so I cannot consider
the McGimpsey solution which requires the photos to be hidden in the excel
document.
Following the insert of the picture. I would prefer that the picture is
scaled to fit, but if this is not possible, I can scale the original pictures
myself before saving them into the directory.  - Masquer le texte des messages précédents -

- Afficher le texte des messages précédents -
 

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