Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
bob bob is offline
external usenet poster
 
Posts: 52
Default file location, defaults

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....
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default file location, defaults

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


--
Regards,
Tom Ogilvy

"bob" wrote in message
...
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....



  #3   Report Post  
Posted to microsoft.public.excel.programming
bob bob is offline
external usenet poster
 
Posts: 52
Default file location, defaults

THANK YOU!! that's it!!!
-----Original Message-----
With ActiveSheet.QueryTables.Add_
(Connection:="TEXT;" & ThisWorkbook.Path

& "\userlist.csv", _
Destination:=Range("A1"))


--
Regards,
Tom Ogilvy

"bob" wrote in

message
...
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....



.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hyperlink .txt file defaults to Notepad. How switch to GVIM? grokok Excel Discussion (Misc queries) 0 February 17th 10 10:46 PM
Set Defaults in File Import of a Text File Dkline Excel Worksheet Functions 2 January 28th 08 06:20 PM
Print defaults for e-mailed file Tasha Excel Discussion (Misc queries) 0 December 19th 07 07:36 PM
Subject line in email defaults to workbook file name. swellett Excel Discussion (Misc queries) 0 March 17th 06 04:55 PM
Subject line in email defaults to workbook file name. swellett Excel Discussion (Misc queries) 2 March 17th 06 04:35 PM


All times are GMT +1. The time now is 03:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"