Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
reference a closed filed from a cell and formula in an open file | Excel Worksheet Functions | |||
hyperlink - PDF file - relative reference | Excel Worksheet Functions | |||
Linked value to cell in different workbook + Relative File Reference | Excel Discussion (Misc queries) | |||
Using an offset formula for the reference in a relative reference | Excel Worksheet Functions | |||
Formula to get Relative Folder Reference to data in another file? | Excel Worksheet Functions |