Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to view graphic files from excel?
Dear all,
Let I have excel sheet with two columns: RefNo, Description g1234 file1 g1235 file2 g1236 file3 ................ First column cell values connected with graphic file names from the same directory. This means that I have graphic files: g1234.jpg, g1235.jpg, g1236.jpg ....in the same directory there is opened worksheet. I want to write program which will operate by following way: If I will click cell with the value g1234 then I want to view graphic file g1234.jpg. This means that will be appeared window (maybe Internet Explorer window or other) there I will see graphic file g1234.jpg. I will appreciate any your help. Lado |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to view graphic files from excel?
Lado,
Try the following code in the code module for the appropriate worksheet: Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim WS As Worksheet Set WS = ActiveSheet WS.OLEObjects("Image1").Object.Picture = _ LoadPicture(ThisWorkbook.Path & "\" & Target.Text & ".jpg") End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Kiknadze Lado" wrote in message ... Dear all, Let I have excel sheet with two columns: RefNo, Description g1234 file1 g1235 file2 g1236 file3 ............... First column cell values connected with graphic file names from the same directory. This means that I have graphic files: g1234.jpg, g1235.jpg, g1236.jpg ....in the same directory there is opened worksheet. I want to write program which will operate by following way: If I will click cell with the value g1234 then I want to view graphic file g1234.jpg. This means that will be appeared window (maybe Internet Explorer window or other) there I will see graphic file g1234.jpg. I will appreciate any your help. Lado |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to view graphic files from excel?
Or, more robust,
Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim WS As Worksheet Dim FName As String If Not Application.Intersect(Range("A1:A10"), Target) _ Is Nothing Then FName = ThisWorkbook.Path & "\" & Target.Text & ".jpg" If Dir(FName) < "" Then Set WS = ActiveSheet WS.OLEObjects("Image1").Object.Picture = _ LoadPicture(FName) End If End If End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Chip Pearson" wrote in message ... Lado, Try the following code in the code module for the appropriate worksheet: Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim WS As Worksheet Set WS = ActiveSheet WS.OLEObjects("Image1").Object.Picture = _ LoadPicture(ThisWorkbook.Path & "\" & Target.Text & ".jpg") End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Kiknadze Lado" wrote in message ... Dear all, Let I have excel sheet with two columns: RefNo, Description g1234 file1 g1235 file2 g1236 file3 ............... First column cell values connected with graphic file names from the same directory. This means that I have graphic files: g1234.jpg, g1235.jpg, g1236.jpg ....in the same directory there is opened worksheet. I want to write program which will operate by following way: If I will click cell with the value g1234 then I want to view graphic file g1234.jpg. This means that will be appeared window (maybe Internet Explorer window or other) there I will see graphic file g1234.jpg. I will appreciate any your help. Lado |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to view graphic files from excel?
Make the refno a hyperlink.
Insert=Hyperlink. -- Regards, Tom Ogilvy Kiknadze Lado wrote in message ... Dear all, Let I have excel sheet with two columns: RefNo, Description g1234 file1 g1235 file2 g1236 file3 ............... First column cell values connected with graphic file names from the same directory. This means that I have graphic files: g1234.jpg, g1235.jpg, g1236.jpg ....in the same directory there is opened worksheet. I want to write program which will operate by following way: If I will click cell with the value g1234 then I want to view graphic file g1234.jpg. This means that will be appeared window (maybe Internet Explorer window or other) there I will see graphic file g1234.jpg. I will appreciate any your help. Lado |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to view graphic files from excel?
Thank you all. This helped me.
Best, Lado "Tom Ogilvy" wrote in message ... Make the refno a hyperlink. Insert=Hyperlink. -- Regards, Tom Ogilvy Kiknadze Lado wrote in message ... Dear all, Let I have excel sheet with two columns: RefNo, Description g1234 file1 g1235 file2 g1236 file3 ............... First column cell values connected with graphic file names from the same directory. This means that I have graphic files: g1234.jpg, g1235.jpg, g1236.jpg ....in the same directory there is opened worksheet. I want to write program which will operate by following way: If I will click cell with the value g1234 then I want to view graphic file g1234.jpg. This means that will be appeared window (maybe Internet Explorer window or other) there I will see graphic file g1234.jpg. I will appreciate any your help. Lado |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I view two different excel files on two different screens? | Excel Discussion (Misc queries) | |||
View the latest files used in Excel | Setting up and Configuration of Excel | |||
Can I display various Graphic Files based on Condition? | Excel Discussion (Misc queries) | |||
Want to view excel files in separate windows | Excel Discussion (Misc queries) | |||
How canI view excel files on the taskbar? | Excel Discussion (Misc queries) |