ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Default File Location (https://www.excelbanter.com/excel-programming/316068-re-default-file-location.html)

Kevin

Default File Location
 
I save the default value and restore it. My problem is, this is not working
consistently. Sometimes I can set the value and sometimes I can not.

Kevin

"keepITcool" wrote:

I'd NOT interfere with the DefaultFilePath.
(some users are attached to it..)

I'd define a constant somewhere
Public const sPATH = "C:\Mydir"

and code like..

ChDrive sPATH
ChDir sPATH



keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


?B?S2V2aW4=?= wrote in message
:

I am attempting to set the Default File Location for an application I
m developing. I am using the following comand:

Application.DefaultFilePath = "C:\myPath"

I save the existing value and want to reset when the file exits. My
problem is, this works intermittently and I am not sure why. I can
grab and save the existing value with no problem, but setting this
value does not always work. Any ideas? The path exists, so it is not
that the correct path does not exist.

Thanks in advance for the help!

Kevin




keepITcool

Default File Location
 
Forget the defaultfilepath.

Excel uses it ONLY when it starts... to set the current directory.
(the directory remains current until the user decides to select another
one.


As I said.. the only way to be sure of 'being' in a folder is to change
to it before you show any dialogs or open/save files.




--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Kevin wrote :

I save the default value and restore it. My problem is, this is not
working consistently. Sometimes I can set the value and sometimes I
can not.

Kevin

"keepITcool" wrote:

I'd NOT interfere with the DefaultFilePath.
(some users are attached to it..)

I'd define a constant somewhere
Public const sPATH = "C:\Mydir"

and code like..

ChDrive sPATH
ChDir sPATH



keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


?B?S2V2aW4=?= wrote in message
:

I am attempting to set the Default File Location for an
application I m developing. I am using the following comand:

Application.DefaultFilePath = "C:\myPath"

I save the existing value and want to reset when the file exits.
My problem is, this works intermittently and I am not sure why. I
can grab and save the existing value with no problem, but setting
this value does not always work. Any ideas? The path exists, so
it is not that the correct path does not exist.

Thanks in advance for the help!

Kevin





All times are GMT +1. The time now is 04:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com