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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

chdir not working

Status
Not open for further replies.

venkman

Programmer
Oct 9, 2001
467
US
I have a macro with the following code:

ChDir ThisWorkbook.Path
MsgBox ThisWorkbook.Path
MsgBox CurDir

The first message box displays "e:\results" a folder on a mapped network drive. The second message box displays the mydocuments folder. Why isn't the second the same as the first?

-Venkman
 
Think I've answered my own question:

must add this line to beginning:
ChDrive Mid(thisWorkbook.Path, 1, 1)

-Venkman
 
Actually,

ChDrive thisworkbook.path

will do as well :)
(everything after the first letter gets ignored).

Rob
[flowerface]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top