Image viewer in excel

msaiyad

Board Regular
Joined
Mar 23, 2008
Messages
93
I want to set a image viewer with excel where I select any cell read that cell and show the same image in that viewer
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /><v:rect id=_x0000_s1026 style="MARGIN-TOP: 12.6pt; Z-INDEX: 1; MARGIN-LEFT: 207pt; WIDTH: 117pt; POSITION: absolute; HEIGHT: 81pt"></v:rect><o:p> <TABLE cellSpacing=0 cellPadding=0 width="100%"><TBODY><TR><TD style="BORDER-RIGHT: #ece9d8; BORDER-TOP: #ece9d8; BORDER-LEFT: #ece9d8; BORDER-BOTTOM: #ece9d8; BACKGROUND-COLOR: transparent">
<o:p></o:p>​
Image viewer

</TD></TR></TBODY></TABLE>
</o:p>


A
1 Abc_xy45
2 xyz_er45
(these all are style no )
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
I made a folder where I store all images with style no
it will be same no in A Column
So when I select any style no I can able to see image in image viewer is this possible ?Plz help
 
Re: Image viewer in excel JPG FORMAT ???

All images store in C:Photos
and all are in jpg format code can read c:\photo\dsc14510
but by this file is not opening i think some where i need to add extension
& .jpg
but where plz help ?
 
Upvote 0
JPG extension we need to add some where
C:PHOTOS/DSC4575
this is reading but file need extension to open
C:photos/dsc4575.JPG
but how to add extension

MyFolder = "C:\photos\"
MyFile = MyFolder & Target.Value &."JPG "' CELL VALUE"


:confused: Plz help
 
Upvote 0
I suggest you set the macro recorder on and manually use Insert/Picture from file. You will then get some code to compare with mine (original code !!). 'MyFile' needs to contain whatever you get for the file name in the macro including the path. So you either put the path in the cell or add the folder later as I have done.
 
Upvote 0
Re: Image viewer in excel with selection code

Picture is insert in sheet but not in proper cell and not in fix size

there should be some problam in with selection code
Please check it

ws.Pictures.Insert(MyFile).Selection
With Selection
.Top = MyCell.Top
.Left = MyCell.Left
.Width = MyCell.Width
.Height = MyCell.Height
.Placement = xlMoveAndSize
.PrintObject = True
End With
 
Upvote 0
run time error 438

Obeject does't support this property or method

this error comes when i try to run on this code
showing debug
ws.Pictures.Insert(MyFile).Selection
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top