Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Displaying Chart Data ontop of Image | Charts and Charting in Excel | |||
Hyperlink to an image in other worksheet, displaying entire image. | Excel Worksheet Functions | |||
HOW DO I GET RID OF MIRROR IMAGE FILES | Excel Discussion (Misc queries) | |||
Displaying a Tif image in the Image Control | Excel Programming | |||
adding Tiff files to the list of image files | Excel Programming |