Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Open file with relative reference


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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Open file with relative reference


Hi Jim,

Thanks for your reply. The ThisWorkbook.path sounds like a good idea,
but I am not sure how to add that information and the filename to the
Workbook.Open Filename=() function.

Thanks, Simon


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

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
reference a closed filed from a cell and formula in an open file dh13134 Excel Worksheet Functions 15 August 6th 08 08:08 PM
hyperlink - PDF file - relative reference eugene Excel Worksheet Functions 4 November 10th 07 01:59 PM
Linked value to cell in different workbook + Relative File Reference [email protected] Excel Discussion (Misc queries) 0 February 8th 07 04:57 PM
Using an offset formula for the reference in a relative reference Cuda Excel Worksheet Functions 6 November 15th 06 05:12 PM
Formula to get Relative Folder Reference to data in another file? RocketDude Excel Worksheet Functions 0 August 17th 05 10:03 PM


All times are GMT +1. The time now is 12:11 PM.

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"