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

I'm am using the GetOpenFilename method to allow a user to
pick a spreadsheet to open. This is to by-payss the
enable/disable macro option. I want to start the user in
a specific network folder(instead of their
defaultfilepath). Is there a way to do this?

I have tried the Application.DefaultFilePath = ("xxxx")
but this only changes the default folder the next time the
user accesses the the system and not the current instance.

Thanks,

Brian.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default specifing default folder with GetOpenFilename

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



"Brian" wrote in message ...
I'm am using the GetOpenFilename method to allow a user to
pick a spreadsheet to open. This is to by-payss the
enable/disable macro option. I want to start the user in
a specific network folder(instead of their
defaultfilepath). Is there a way to do this?

I have tried the Application.DefaultFilePath = ("xxxx")
but this only changes the default folder the next time the
user accesses the the system and not the current instance.

Thanks,

Brian.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default specifing default folder with GetOpenFilename



--

HTH

Bob Phillips

"Brian" wrote in message
...
I'm am using the GetOpenFilename method to allow a user to
pick a spreadsheet to open. This is to by-payss the
enable/disable macro option. I want to start the user in
a specific network folder(instead of their
defaultfilepath). Is there a way to do this?

I have tried the Application.DefaultFilePath = ("xxxx")
but this only changes the default folder the next time the
user accesses the the system and not the current instance.

Thanks,

Brian.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default specifing default folder with GetOpenFilename

Brian,

Use ChDrive and ChDir,

ChDrive "C:\"
ChDir "C:\"

--

HTH

Bob Phillips

"Brian" wrote in message
...
I'm am using the GetOpenFilename method to allow a user to
pick a spreadsheet to open. This is to by-payss the
enable/disable macro option. I want to start the user in
a specific network folder(instead of their
defaultfilepath). Is there a way to do this?

I have tried the Application.DefaultFilePath = ("xxxx")
but this only changes the default folder the next time the
user accesses the the system and not the current instance.

Thanks,

Brian.



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
Specifing Cells to Sum on Condition phuser[_2_] Excel Worksheet Functions 2 June 24th 08 11:39 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
Change Default Add-in Folder compound Excel Discussion (Misc queries) 2 July 13th 05 10:25 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
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 02:44 AM.

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"