Default File Location

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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 >


=?Utf-8?B?S2V2aW4=?= wrote in message
 
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
 
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 :
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Saving in VBA to a particular location 3
Active or current file path 9
DIR - Excel VBA function 1
Default File Path 2
Detect file. 2
on error help 4
Folder location for Addins 9
Access Print Files from Query Results 0

Back
Top