View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
jeffP jeffP is offline
external usenet poster
 
Posts: 38
Default same workbook different paths (home/work)

HI,
I have a few workbooks that I use at work and at home. They use other files
through code to import data / export data.
My problem is the paths in the code. At home I may be working in C:\my
documents\MIS\Invoices, retrieving a file from C:\Data\finance\mydir ,
exporting finished data to C:\WorkDocs\xyzcarsales\2004 and saving a copy of
the workbook in D:\Backups\work\etc
When I move the worksheet to my work computer I must go into the code to
change all these paths. Then someone wants to put it on a laptop and all the
paths there must be changed there too! This invariably is done wrong and
causes 'run time error 1004' when calling for the files.
Obviously, setting up the drive/directory paths to match on all three
would help. Maybe just having to search and replace the drive letter would
be simpler and less error prone but.... what if someone else wants to use it
on another laptop, etc. I imagine this is a fairly common thing and
wondered how experienced people handled it.

Any help is always appreciated.

--
jeff

... I used to have a handle on life, but it broke.