View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jan Karel Pieterse Jan Karel Pieterse is offline
external usenet poster
 
Posts: 535
Default GetopenFilename default path

Hi,

Sub GetOpenFileNameExample()
Dim vFilename As Variant
Dim sPath As String
sPath = "c:\windows\temp\"
ChDrive sPath
ChDir sPath
vFilename = Application.GetOpenFilename("Microsoft
Excel Files (*.xls),*.xls", , "Please select the file(s)
to open", , False)
If TypeName(vFilename) = "Boolean" Then Exit Sub
If CStr(vFilename) = "" Then Exit Sub
If Dir(CStr(vFilename)) < "" Then
MsgBox "Exists!!!"
Else
' Now do something with vfilename, like:
' Workbook.Open Filename:=vFilename
End If
End Sub


Regards,

Jan Karel Pieterse
Excel TA/MVP

-----Original Message-----
Hello ,

I would like to know how i can give a Default Path (say

c:\xxxx\yyyy\zzzz)
when using GetopenFilename. Is this possible or is there

any other method to
do the same?
I'm using Excel 97

Regards,
SSR


.