file location, defaults

B

bob

Hi and thank you in advance..

I am trying to create an xls file that automatically
imports from CSV on open... This works well, BUT I want
to be able to duplicate this is other folders without
rewriteing the script...

This is part of what I have working >

With ActiveSheet.QueryTables.Add_
(Connection:="TEXT;F:\APPS\FVBU\zList\userlist.csv", _
Destination:=Range("A1"))

IT wont work without specifying the full path...
Is there a variable that holds the path to the XLS file
that is open...
The VSC and XLS will always be in the same folder...
Thank you....
 
T

Tom Ogilvy

With ActiveSheet.QueryTables.Add_
(Connection:="TEXT;" & ThisWorkbook.Path & "\userlist.csv", _
Destination:=Range("A1"))
 
B

Bob

THANK YOU!! that's it!!!
-----Original Message-----
With ActiveSheet.QueryTables.Add_
(Connection:="TEXT;" & ThisWorkbook.Path & "\userlist.csv", _
Destination:=Range("A1"))


--
Regards,
Tom Ogilvy




.
 
Top