Insert Picture Macro
You could get the filename yourself:
Option Explicit
Sub testme02()
Dim myPictureName As Variant
Dim myCurFolder As String
Dim myNewFolder As String
myCurFolder = CurDir
myNewFolder = "C:\my documents\excel"
ChDrive myNewFolder
ChDir myNewFolder
myPictureName = Application.GetOpenFilename _
(filefilter:="Picture Files,*.jpg;*.bmp;*.tif;*.gif")
ChDrive myCurFolder
ChDir myCurFolder
If myPictureName = False Then
Exit Sub 'user hit cancel
End If
'do the real work
End Sub
SamDev wrote:
In a portion of a macro, I would like the macro to open Insert Picture
dialog box and then go to a particular folder - I can get the macro to open
to the My Pictures folder but then I would have to ask user to select a
different folder - I would prefer that the macro selected the folder.
The macro I am using is:
dlgAnswer = Application.Dialogs(xlDialogInsertPicture).Show
Much thanks.
--
Dave Peterson
|