ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Is there any way to attach a jpg thumbnail to a row (https://www.excelbanter.com/excel-programming/343269-there-any-way-attach-jpg-thumbnail-row.html)

Denny Smith

Is there any way to attach a jpg thumbnail to a row
 
I am useing Excel as a data base and would like to attach jpg thumnail to a
row. Is this possible? Thanks for your help

Tom Ogilvy

Is there any way to attach a jpg thumbnail to a row
 
can you do it with Insert=Picture from File?

can you do it with pasting the picture from the clipboard.

After it is in the worksheet. right click on it and see if you can select
format=Protection Tab, move with cell


--
Regards,
Tom Ogilvy


"Denny Smith" <Denny wrote in message
...
I am useing Excel as a data base and would like to attach jpg thumnail to

a
row. Is this possible? Thanks for your help




baj

Is there any way to attach a jpg thumbnail to a row
 
Hi,

I suppose you are able to select the cell that contains the name of the
jpg-file you want to show and pass it in "name" in the next procedure,
the object "photo" is in fact a userform in which you are going to
project the real photo.
Another MUST here is that the JPG-pictures are in the same directory of
your Excelfile because of the path in the procedure.
You also have to produce a jpg-file called no.jpg (with the message :
No Photo available) in case there is no picturename available in the
selected cell...

Well have a look, and try it out...



Sub loading_photo(name As String, photo As Object)

Dim picturename As String, complete As String, path As String

picturename = name & ".jpg"
path = ThisWorkbook.path
complete = path & "\" & picturename

If FileExists(picturename) Then
photo.Picture = LoadPicture(complete)
photo.PictureSizeMode = fmPictureSizeModeClip

Else
' no.jpg has to be a jpg with the message : No Photo Available
complete = path & "\" & "no.jpg"
photo.Picture = LoadPicture(complete)
photo.PictureSizeMode = fmPictureSizeModeClip

End If

End Sub


Bye
Baj



All times are GMT +1. The time now is 07:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com