PDA

View Full Version : Setcurrentdirectory not using API?



Peter458
09-18-2010, 03:54 AM
Really..... hope you can help

I need to be able to set current directory without making an api call as change to Windows 7 client machine has restrictions.

Currently using
Private Declare Function SetCurrentDirectory Lib "kernel32" Alias "setCurrentDirectoryA" (ByVal lpPathName As String) As Long

GTO
09-18-2010, 04:49 AM
I am probably misunderstanding, but maybe:

ChDrive "D"
ChDir "D:\2010\_Tmp\2010-09-17\"

GTO
09-18-2010, 04:52 AM
BTW, at least on my poor ol' laptop, this fails:

Alias "setCurrentDirectoryA"

This succeeds:

Alias "SetCurrentDirectoryA"

Peter458
09-18-2010, 05:23 AM
Hi no unfortunately it was a typo when posting here rather than a typo in the code...

its for the network name rather than a local Drive letter (although I may have to go down that road).

GTO
09-18-2010, 07:14 AM
Peter458,

I see that you recently joined. Please read Here (http://www.excelguru.ca/node/7).

Cross-posted at: http://www.mrexcel.com/forum/showthread.php?t=495760

Peter458
09-18-2010, 08:15 AM
I didnt know it was not a good idea. I was just looking for results. Apologies... Please close / delete this Thread.. I'll keep it on the other forum thank oyu for the info though I do appreciate it ..just new to forums and in a hurry/desparate