LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 331
Default Changing path for import file

My macro imports a couple of csv files that are always located in the
c:\users\username\documents\data folder, with username being the user whose
computer the spreadsheet is being used on. Unfortunately for me, whenever I
make a change to the macro, I have to create a separate copy for each
individual so that the file path to the csv file that's being imported is
correct. The portion of the code that refers to the file reads:

With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:\Users\username\Documents\Data\Import. csv" _
, Destination:=Range("A3"))
.Name = "Import"

Is there a way to code this so I don't have to change the path for each user?

Thanks for any help.
 
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
Import text file contents based on path crazybass2 Excel Programming 4 November 11th 07 01:23 PM
Formula too long - new file path is shorter than old file path - Excel 2003 Greg J Excel Worksheet Functions 1 November 22nd 06 05:16 PM
import external data from changing file name nathan Excel Worksheet Functions 2 April 6th 05 04:39 PM
VBE, change default path for file import Werner Rohrmoser Excel Programming 2 March 17th 05 08:17 AM
Import text file without specifying a path macro won't work Bruiser Excel Programming 3 January 20th 04 11:47 PM


All times are GMT +1. The time now is 06:57 AM.

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

About Us

"It's about Microsoft Excel"