View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
rbmcclen[_4_] rbmcclen[_4_] is offline
external usenet poster
 
Posts: 1
Default Relative import locations in macro


Hi,
How do I make the text import location of a file relative to the
location of the workbook?

My macro imports a text file 01.txt from the same location the workbook
is located:

With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:\Project\07 July\01.txt", Destination _
:=Range("C2"))

So that I can move the spreadsheet to other folders containing the same
named files and it still work?


--
rbmcclen
------------------------------------------------------------------------
rbmcclen's Profile: http://www.excelforum.com/member.php...o&userid=36367
View this thread: http://www.excelforum.com/showthread...hreadid=563437