file location, defaults

  • Thread starter Thread starter bob
  • Start date Start date
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....
 
With ActiveSheet.QueryTables.Add_
(Connection:="TEXT;" & ThisWorkbook.Path & "\userlist.csv", _
Destination:=Range("A1"))
 
THANK YOU!! that's it!!!
-----Original Message-----
With ActiveSheet.QueryTables.Add_
(Connection:="TEXT;" & ThisWorkbook.Path & "\userlist.csv", _
Destination:=Range("A1"))


--
Regards,
Tom Ogilvy




.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top