Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default 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
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
Inserting Pictures cjohnson Excel Discussion (Misc queries) 2 April 2nd 08 07:00 PM
Inserting Pictures DamienO Excel Discussion (Misc queries) 2 October 31st 07 12:40 PM
Inserting Pictures Help Please Chris Hankin[_3_] Excel Programming 0 March 27th 07 10:59 AM
Inserting Pictures mudraker[_356_] Excel Programming 3 April 10th 06 09:35 AM
inserting pictures Denny[_2_] Excel Programming 5 November 16th 04 01:49 AM


All times are GMT +1. The time now is 09:04 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"