View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_5_] Jim Thomlinson[_5_] is offline
external usenet poster
 
Posts: 486
Default Open file with relative reference

Thisworkbook.path

returns the path of the workbook. The file must be save for it to have a
path, but that does not sound like an issue here...
--
HTH...

Jim Thomlinson


"simonhall" wrote:


Hi,

Workbook A and workbook B are two excel files in the same directory,
and always will be however the location of that directory may change
(ie from 'C:\files\excel' to 'D:\programs\data'.

In workbook A, I need a macro that will open workbook B.
I have tried the workbooks.open filename('workbook B.xls'). However,
this only works if the full location of the file is listed and thus
does not work when both the files are shifted to the new directory.

Can you please help me to open a workbook with a relative reference to
the location.

Thannks, Simon


--
simonhall
------------------------------------------------------------------------
simonhall's Profile: http://www.excelforum.com/member.php...o&userid=30582
View this thread: http://www.excelforum.com/showthread...hreadid=502291