thanks again bob....before i go any further, i have a query......to ditermine where the image pastes, can i use a heading??
IE: the sheet has certain sub headings like 'machine' and 'roller'. Can i use these headings as the targets in some way. I would like the image to paste into the empty cell beneath the heading. For each heading, the user would select an image
Thanks!!!!!
----- Rob Bovey wrote: ----
Hi Gav
If that's the case then you should probably leave the images in th
folder and write code to allow the user to select the image they want. I di
forget to ask what exactly you wanted to do with the image, but regardless
here's some code to get you started. The most complicated part is gettin
the path to the My Documents folder on the user's computer. Allowing them t
select an image and stick it on a worksheet is very easy
Private Const S_OK As Long =
Private Const SHGFP_TYPE_CURRENT As Long =
Private Const CSIDL_PERSONAL As Long =
Private Const MAX_PATH As Long = 25
Private Declare Function SHGetFolderPathA Lib "Shell32.dll"
(ByVal hWndOwner As Long,
ByVal nFolder As Long,
ByVal hToken As Long,
ByVal dwFlags As Long,
ByVal szPath As String) As Lon
Public Sub InsertImage(
Dim szPath As Strin
Dim vFullName As Varian
szPath = szGetMyDocsPath() & "\
If Len(szPath) > 0 The
ChDrive szPat
ChDir szPat
vFullName = Application.GetOpenFilename(
"Image Files (*.jpg),*.jpg", , "Select an Image"
If vFullName <> False The
Sheet1.Pictures.Insert CStr(vFullName
End I
Els
MsgBox "My Documents folder not found.
End I
End Su
Private Function szGetMyDocsPath() As Strin
Dim szPath As Strin
szPath = String$(MAX_PATH, vbNullChar
If SHGetFolderPathA(0&, CSIDL_PERSONAL, 0&, SHGFP_TYPE_CURRENT,
szPath) = S_OK The
szGetMyDocsPath = Left$(szPath, InStr(szPath, vbNullChar)
End I
End Functio
--
Rob Bovey, MCSE, MCSD, Excel MV
Application Professional
http://www.appspro.com
* Please post all replies to this newsgroup
* I delete all unsolicited e-mail responses
Gav said:
would be the same for each user on their local hard drive (my documents)
The images would rarely change...it would serve only as a database of image
for the user. Any new images would be updated directly into the targe
folder