Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using ChDir function on network resource

Status
Not open for further replies.

GlennUK

MIS
Apr 8, 2002
2,937
GB
Hi all,

I'm trying to use ChDir on a network resource like this:

ChDir "\\svr10\XYZ\ABCD"

but this doesn't change what the active directory is. I know that you issue a ChDrive command to point to the correct mapped drive when the resource you want is a mapped drive, but I need to know what to do to make this network resource the active working directory.

Do I need to issue a mapping command to get this resource allocated to a drive letter, and then issue the ChDrive command?

Thanks, Glenn.
 
Hi,

I assume you mean the default file path on the General tab of Tools > Options.

Code:
Application.DefaultFilePath "\\YourServer\YourPath"

Hope this helps.


Leigh Moore
Solutions 4 MS Office Ltd
 
Hi Leigh Moore,

you assume wrong I'm afraid. I don't want to change the default file path, I want to change the current drive to point at the network resource.

( By the way, you missed the "=" out of your statement )

Cheers, Glenn.
 
Got a workaround.

I was going to use ChDir followed by Dir to get all the files on a network resource.

Instead I used:
myname = Dir("\\svr10\XYZ\ABCD\*.xls")

followed by calls to Dir without args, and it does what I want.

Thanks anyway.
Cheers, Glenn.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top