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

External Data Query path problem

Status
Not open for further replies.

deltaair

IS-IT--Management
Nov 3, 2005
43
CH
I have the following code in a macro that extracts data from a folder on a shared drive.

With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;J:\Airport Customer Service\Analyst\Coop\Herby Folder\HERBY PROGRAM\HRBDATA.TXT" _
, Destination:=Range("A1"))
.Name = "HRBDATA"
End With

How do I make the path for this file so that it always uses the same folder as the current file like a "\HRBDATA.txt" or something. ( I tried that already ). So i need a path reference or something that always accesses the current folder as a default folder.
 
The Workbook.Path property ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top