Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Inserting Pictures MKII
Hello,
Could some one please help me with the following? I have some jpg pictures in the following folder location: G:\WLMAEWCSPO\LMU\LOGISTICS PREPAREDNESS SYSTEMS\LOGPREP SYS\V&A AND SCA ITEM PHOTOS\ I need a macro so that when a user double-clicks on a certain cell in column B then a window opens up enabling the user to select the desired jpg picture and to insert the picture into the cell (the user just doubled-clicked on)in my workbook named "Items". Any help would be greatly appreciated. Thanks, Chris. *** Sent via Developersdex http://www.developersdex.com *** |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Inserting Pictures MKII
First, pictures always reside in the drawing layer above the cells, not
in the cell itself. Name your cell(s), say, jpgCells. Then put something like this in your worksheet code module Private Sub Worksheet_BeforeDoubleClick( _ ByVal Target As Excel.Range, Cancel As Boolean) Const csPATH As String = "your path here" Dim sOldDir As String Dim vResult As Variant If Not Intersect(Target, Range("jpgCells")) Is Nothing Then Cancel = True sOldDir = CurDir ChDrive csPATH ChDir csPATH vResult = Application.GetOpenFilename( _ filefilter:="Picture Files,*.jpg") ChDrive sOldDir ChDir sOldDir If vResult = False Then Exit Sub 'user cancelled With Me.Pictures.Insert(vResult) .Top = Target.Top .Left = Target.Left End With End If End Sub In article , Chris Hankin wrote: Hello, Could some one please help me with the following? I have some jpg pictures in the following folder location: G:\WLMAEWCSPO\LMU\LOGISTICS PREPAREDNESS SYSTEMS\LOGPREP SYS\V&A AND SCA ITEM PHOTOS\ I need a macro so that when a user double-clicks on a certain cell in column B then a window opens up enabling the user to select the desired jpg picture and to insert the picture into the cell (the user just doubled-clicked on)in my workbook named "Items". Any help would be greatly appreciated. Thanks, Chris. *** Sent via Developersdex http://www.developersdex.com *** |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Inserting Pictures MKII
Thanks so much JE McGimpsey for your excellent work and help - very much appreciated. Cheers, Chris. *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Inserting Pictures | Excel Discussion (Misc queries) | |||
Inserting Pictures | Excel Discussion (Misc queries) | |||
Inserting Pictures Help Please | Excel Programming | |||
Inserting Pictures | Excel Programming | |||
inserting pictures | Excel Programming |