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

Change Current Drive in Excel VBA

Status
Not open for further replies.

hughesai

Technical User
Joined
Aug 1, 2002
Messages
101
Location
GB
Hi,

I have a file I want to open through Excel VBA.
It is always on a network area e.g. \\server\sharename$.
I am using the code below to pick the filename
stFileName = Application.GetOpenFilename("Text Files (*.txt),*.txt")
This always points to C:\My Documents.
I have tried uing ChDir ("\\server\sharename$") to change the current directory.
However, this does not change the current drive, and the GetOpenFilename method is still pointing to My Documents on C:

Can anyone tell me how to point to my network area?

Thanks,

Aidan Hughes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top