Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default GetOpenFilename

Is there a way to set the GetOpenFilename command to start in a specific
directory?

NameOfFile = Application _
.GetOpenFilename("Excel Files (*.xls), *.xls")
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default GetOpenFilename

Hi

Try this

Sub test()
Dim FName As Variant
Dim wb As Workbook
Dim MyPath As String
Dim SaveDriveDir As String

SaveDriveDir = CurDir

MyPath = "C:/Chrysant"
ChDrive MyPath
ChDir MyPath

FName = Application.GetOpenFilename(filefilter:="Excel Files (*.xls),
*.xls")
If FName < False Then
Set wb = Workbooks.Open(FName)
MsgBox "your code"
wb.Close
End If

ChDrive SaveDriveDir
ChDir SaveDriveDir

End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"wtpcomplab" wrote in message
...
Is there a way to set the "GetOpenFilename" command to start in a specific
directory?

NameOfFile = Application _
.GetOpenFilename("Excel Files (*.xls), *.xls")



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default GetOpenFilename

Ron's method is probably best, but if you want some more pain and suffering
in your life, it looks like the FileDialog method in Office 10 / Office XP
would do this, too :)

James Cox
"wtpcomplab" wrote in message
...
Is there a way to set the "GetOpenFilename" command to start in a specific
directory?

NameOfFile = Application _
.GetOpenFilename("Excel Files (*.xls), *.xls")



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default GetOpenFilename

Thank You

Dan

"James Cox" wrote:

Ron's method is probably best, but if you want some more pain and suffering
in your life, it looks like the FileDialog method in Office 10 / Office XP
would do this, too :)

James Cox
"wtpcomplab" wrote in message
...
Is there a way to set the "GetOpenFilename" command to start in a specific
directory?

NameOfFile = Application _
.GetOpenFilename("Excel Files (*.xls), *.xls")




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default GetOpenFilename

Thank You
Dan

"Ron de Bruin" wrote:

Hi

Try this

Sub test()
Dim FName As Variant
Dim wb As Workbook
Dim MyPath As String
Dim SaveDriveDir As String

SaveDriveDir = CurDir

MyPath = "C:/Chrysant"
ChDrive MyPath
ChDir MyPath

FName = Application.GetOpenFilename(filefilter:="Excel Files (*.xls),
*.xls")
If FName < False Then
Set wb = Workbooks.Open(FName)
MsgBox "your code"
wb.Close
End If

ChDrive SaveDriveDir
ChDir SaveDriveDir

End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"wtpcomplab" wrote in message
...
Is there a way to set the "GetOpenFilename" command to start in a specific
directory?

NameOfFile = Application _
.GetOpenFilename("Excel Files (*.xls), *.xls")




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
GetOpenFilename Chodu Excel Programming 1 May 17th 04 06:17 PM
GetOpenFilename Todd Htutenstine Excel Programming 2 May 13th 04 03:14 PM
GetOpenFilename Greg Bloom Excel Programming 0 February 9th 04 03:32 PM
GetOpenFilename Wolfgang Excel Programming 1 February 6th 04 07:37 PM
Using GetOpenFilename Robin Seaby Excel Programming 2 August 6th 03 04:50 PM


All times are GMT +1. The time now is 02:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"