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

Macro load data from mapped network drive 1

Status
Not open for further replies.

mitchellr

Programmer
Feb 2, 2004
10
AU
Hello all,

Will list some code below I am trying to execute.

Have a client who will execute a program from a
shared network drive. Wanting to automatically load a file from network to my excel sheet program. My issue is that on different users computers it might be mapped as F or J or X drive. My code below:

With ActiveSheet.QueryTables.Add(Connection:= _
"ODBC;DSN=loadsheet;DefaultDir=j:\abc;DriverId=27;FIL=text;MaxBufferSize=2048;PageTimeout=5;" _
, Destination:=Range("A1"))

Instead of inserting j: in code is there some way I can incoporate the actual network location, in my scenario
'clients on 'mhw-abc-ex1'

Thanks
 
Yep, try:

\\mhw-abc-ex1\Clients\abc etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top