View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default macro to locate picture

Try it this way...

Application.GetOpenFilename ("Graphic Files (*.jpg;*.gif;*.bmp;*.png)," & _
"*.jpg;*.gif;*.bmp;*.png,JPEG Files (*.jpg)," & _
"*.jpg,GIF Files (*.gif),*.gif,BMP Files (*.bmp)," & _
"*.bmp,PNG Files (*.png),*.png,All Files (*.*),*.*")


--
Rick (MVP - Excel)


"Rhino V" wrote in message
...
Joel,
What if you want ALL graphic files to show, e.g., .jpg, .gif, .bmp, .png?
How would the code be written?
Thanx.

"Joel" wrote:


fileToOpen = Application _
.GetOpenFilename("All Files (*.jpg),*.jpg")

"gwbdirect" wrote:

Hi Joel,
Thanks for the code.
I want to chenge to photo extensions so how do i write it
.GetOpenFilename (*.jpeg), *.jpeg")
This doesn't work so can you write it properly.
Thanks again


"Joel" wrote:

Use the GetOpenFileName which Displays the standard Open dialog box
and gets
a file name from the user without actually opening any files. Change
.txt to
the picture extension you are using such as .jpg


fileToOpen = Application _
.GetOpenFilename("Text Files (*.txt), *.txt")
If fileToOpen < False Then
MsgBox "Open " & fileToOpen
End If


"gwbdirect" wrote:

Want to crteate a macro that goes to exploerer and allows me to
choose any
photo by clicking on it. Not a specific photo but different ones
each time I
run the macro.
Thanks