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

Hi I apologise if I am asking a commonly question this newsgroup has
answered before.

I pick up a file selected by the user. I want to specify a default folder
from where my user can select his transaction file. Is this possible?

This is what I am currently doing.
TxnFilename = Application.GetOpenFilename("All Files (*.*), *.*", 1, "Import
Transaction Details for List")

Thanks
Andy


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default GetOpenFilename - Default Folder

Andy,

Use a chdir statement.
ie
ChDir ("C:\My Excel Files")
TxnFilename = Application.GetOpenFilename("All Files (*.*), *.*", 1, "ImportTransaction Details for List")

Dan E

"Andy" wrote in message ...
Hi I apologise if I am asking a commonly question this newsgroup has
answered before.

I pick up a file selected by the user. I want to specify a default folder
from where my user can select his transaction file. Is this possible?

This is what I am currently doing.
TxnFilename = Application.GetOpenFilename("All Files (*.*), *.*", 1, "Import
Transaction Details for List")

Thanks
Andy




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default GetOpenFilename - Default Folder

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



"Andy" wrote in message ...
Hi I apologise if I am asking a commonly question this newsgroup has
answered before.

I pick up a file selected by the user. I want to specify a default folder
from where my user can select his transaction file. Is this possible?

This is what I am currently doing.
TxnFilename = Application.GetOpenFilename("All Files (*.*), *.*", 1, "Import
Transaction Details for List")

Thanks
Andy




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

Works like a charm.

Many thanks
Andy


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
... I'd like to change the Default Folder... Dr. Darrell Excel Discussion (Misc queries) 4 September 11th 07 04:12 PM
how can i change my default working folder to a networked folder? wizard1154 Excel Discussion (Misc queries) 4 April 18th 07 07:29 PM
"Save As" folder -- can I default this to the same folder as origi Mike Excel Discussion (Misc queries) 1 June 11th 05 12:06 AM
specifing default folder with GetOpenFilename Brian Excel Programming 3 September 8th 03 01:55 PM
Setting default directory prior to GetOpenFilename David R[_3_] Excel Programming 2 September 2nd 03 12:35 PM


All times are GMT +1. The time now is 12:41 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"