View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default GetOpenFilename Folder specfication

Try this example sub
I will save your default folder first to set it back at the end

Sub test()
Dim SaveDriveDir As String
Dim TheFileName As Variant
SaveDriveDir = CurDir
ChDrive "C"
ChDir "C:\Data"
TheFileName = Application.GetOpenFilename(filefilter:="Excel Files (*.xls), *.xls")

MsgBox "your code"

ChDrive SaveDriveDir
ChDir SaveDriveDir
End Sub



--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Alan" wrote in message ...
How do you specify the initial folder for
Application.GetOpenFilename()?

I've tried numerous Application.* attributes, haven't
been able to find the right one. I also tried specifying
the folder spec in the GetOpenFilename() argument,
doesn't work.