Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Displaying an image without using external files


I am sure there must be a way to solve this because I have seen example
close to what I want but not quite, but my attempts so far have failed.
I would like a user form to display an image that will not be stored o
others' computers.

Ideally I would like the image to display an embedded object but not b
reference of object number or name because it will change regularl
depending on user clicks in a list box (user clicks on the desire
object in the list box, code searches for the entry on the spread shee
and displays the relevant picture which is in a column). If possible,
want to display it by whats in the cell.

I know it is possible to enter a formula in a picture formula box t
display what is in or "over" that cell, but there seems to be no way t
do it for the image box in a form (although it may be something a
simple as a syntax error, I've not been coding that long).

If this isn't possible, I will settle for the syntax to refer to a
embedded image although the resulting code may get a bit spagetti, an
of course it's good practice not to hard code absolute values.

Thanks in advance,
David Bar

--
d.i.bar
-----------------------------------------------------------------------
d.i.barr's Profile: http://www.excelforum.com/member.php...fo&userid=1552
View this thread: http://www.excelforum.com/showthread.php?threadid=27824

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Displaying an image without using external files


hi,

I understand you like to show some of catalog display.

You can have many forms. You can call one form at a time.

Regards
S.Sures

--
s_u_res
-----------------------------------------------------------------------
s_u_resh's Profile: http://www.excelforum.com/member.php...fo&userid=1567
View this thread: http://www.excelforum.com/showthread.php?threadid=27824

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Displaying an image without using external files


I've simulated your combobox with a validation list..
sourced by a list of filenames in ColumnD


you'll need an Embedded Image control
from the control toolbox toolbar.

Make sure it's named "Image1"
Then run ReadFileName for the setup.

Now when cell a1 is changed the picture will follow.



Public Sub ReadFileNames()
Dim sDir$, r&

Range("D:D").Clear
'msoDialogFolderPicker only exist in OFFICE 2000+
If Application.FileDialog(msoFileDialogFolderPicker). Show = False Then
Exit Sub
sDir = Dir("*.jpg")
While sDir < vbNullString
r = r + 1
Range("D" & r) = CurDir & Application.PathSeparator & sDir
sDir = Dir()
Wend
If r 0 Then
Application.EnableEvents = False
With Range("a1")
.ClearContents

.Interior.ColorIndex = 37

.Validation.Delete
.Value = "[Select your picture]"

.Validation.Add xlValidateList, Formula1:="=$D$1:$D$" & r
End With
Application.EnableEvents = True
End If

End Sub



Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count 1 Then Exit Sub
If Target.Address = "$A$1" Then
Image1.Picture = LoadPicture(Range("a1"))
End If
End Sub








--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam

d.i.barr wrote in message
:


I am sure there must be a way to solve this because I have seen

examples
close to what I want but not quite, but my attempts so far have

failed.
I would like a user form to display an image that will not be stored

on
others' computers.

Ideally I would like the image to display an embedded object but not

by
reference of object number or name because it will change regularly
depending on user clicks in a list box (user clicks on the desired
object in the list box, code searches for the entry on the spread

sheet
and displays the relevant picture which is in a column). If possible,

I
want to display it by whats in the cell.

I know it is possible to enter a formula in a picture formula box to
display what is in or "over" that cell, but there seems to be no way

to
do it for the image box in a form (although it may be something as
simple as a syntax error, I've not been coding that long).

If this isn't possible, I will settle for the syntax to refer to an
embedded image although the resulting code may get a bit spagetti, and
of course it's good practice not to hard code absolute values.

Thanks in advance,
David Barr



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying Chart Data ontop of Image Tinkicka Charts and Charting in Excel 1 June 26th 06 02:46 AM
Hyperlink to an image in other worksheet, displaying entire image. twilliams Excel Worksheet Functions 0 February 7th 06 10:02 PM
HOW DO I GET RID OF MIRROR IMAGE FILES RED Excel Discussion (Misc queries) 3 March 16th 05 02:19 AM
Displaying a Tif image in the Image Control Neil Excel Programming 1 September 21st 04 12:56 AM
adding Tiff files to the list of image files ksel[_2_] Excel Programming 0 January 23rd 04 09:22 PM


All times are GMT +1. The time now is 09:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"