Pictures in Excel cells

J

José

Dear friends

I want to create a book with personal descriptions, including pictures.
But how can I get a picture in an Excel cell?

I thought that =HYPERLINK("file.jpg") would be the thing, but the
pictures are not retrieved when I combine the Excel sheet to the final
Word file.

Please help.
 
M

MRT

Do you object if ...

Alt > i > p > f
and select the picture what you want to import.

HTH
 
J

José

Do you object if ...

Alt > i > p > f
and select the picture what you want to import.

I am afraid this procedure depends on the language version (it is
something invented by Mr Bill to discourage international discussions
and encourage the use of the mouse.)

But I think your suggestion equals Insert | Picture | From file. Well
that doesn't work. It does not insert a picture IN a cell.
 
M

MRT

Jose said:
I am afraid this procedure depends on the language version (it is
something invented by Mr Bill to discourage international discussions
and encourage the use of the mouse.)

Thank you for your kindly advice.
But I think your suggestion equals Insert | Picture | From file. Well
that doesn't work. It does not insert a picture IN a cell.

Insert | Picture | From file
promptly after it, pls run following code.

Sub FitPic()
Dim sngCellH As Single, sngCellW As Single
Dim sngCellAR As Single, sngPicAR As Single
With ActiveCell
sngCellH = .Height
sngCellW = .Width
sngCellAR = .Height / .Width
End With
With Selection.ShapeRange
.LockAspectRatio = msoTrue
sngPicAR = .Height / .Width
If sngCellAR > sngPicAR Then
.Width = sngCellW
Else
.Height = sngCellH
End If
End With
End Sub
 
J

José

Insert | Picture | From file
promptly after it, pls run following code.

Sub FitPic()
Dim sngCellH As Single, sngCellW As Single
Dim sngCellAR As Single, sngPicAR As Single
With ActiveCell
sngCellH = .Height
sngCellW = .Width
sngCellAR = .Height / .Width
End With
With Selection.ShapeRange
.LockAspectRatio = msoTrue
sngPicAR = .Height / .Width
If sngCellAR > sngPicAR Then
.Width = sngCellW
Else
.Height = sngCellH
End If
End With
End Sub

I should say that I amazed! I tried it and really, it fits the picture
to the size of the cell. But nevertheless, the picture still hovers over
the worksheet. It can be dragged to another position (that doesn't work
with text in a cell), it can even be made to straddle the border of two
cells and when I inspect the contents of the cell, it is still empty.

And when the contents of the worksheet are read by MSWord, still no
picture appears.
 
L

L. Howard Kittle

This may work for you, adding a picture to a cell comment.

Insert a comment into the cell. Then click on the cell and then Edit
Comment. Right click on the border of the comment, Format comment, Color &
lines, Fill affects, Picture, select picture then OK out.

HTH
Regards,
Howard
 
J

JE McGimpsey

Cells can contain only values or formulae.

All pictures/shapes/etc. exist on drawing layer "above" the cells. The
best you can do is size the picture to fit the cell, then set the Object
positioning Property (Format Picture/Properties) to Move and size with
cells.
 
J

José

This may work for you, adding a picture to a cell comment.

Insert a comment into the cell. Then click on the cell and then Edit
Comment. Right click on the border of the comment, Format comment, Color &
lines, Fill affects, Picture, select picture then OK out.

I tried that too, but I cannot retrieve the picture in MSWord.

I thought it might work to code INCLUDEPICTURE MERGEFIELD in MSWord.
But I do not know how it is done.
 
J

JE McGimpsey

Unfortunately, you can't make up your own program features. There's no
way to get picture information from the cell object - pictures belong to
worsheets, not cells/ranges.

It would certainly be possible to use VBA to check the picture's
position, then use that information to position it in Word. However,
it's not clear to me exactly how you're trying to implement the
"retrieval".
 

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