View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Inserting Images from certain File Folder Take2


You need to perform a chdrive and then ad chdir like below. You can
automatically get each of the filename in the code below rather than use
getopenfilename. If you use getopenfilename you cna modify your code to
allow multiselect so you can select more than one file at a time.

Drive = "D"
chdrive Drive
Folder = "D:\AAA Elder Zornes Documents\01 To Be Processed\" & _
CSM Process Folder\"
chdir = Folder

Picturestring = dir(Folder & "*.jpg")
do while FName < ""
'add your code here
'the filename for each picture is Folder & FName

Picturestring = dir()
loop


"ironhydroxide" wrote:

Previously i asked about inserting all images from a folder, Now my problem
is that when i run the code, it pops up a window, not at the specific folder
i defined, but at the My Documents folder. How does one fix this problem?
below is a snippet of my code

------------------------------------------------------------------------------------------------
Picturestring = Application _
.GetOpenFilename("D:\AAA Elder Zornes Documents\01 To Be Processed\CSM
Process Folder\All Files (*.jpg),*.jpg", , , , True)
------------------------------------------------------------------------------------------------

Thanks for any and all suggestions/replies

Ironhydroxide