Microsoft KB Archive/34155

-

{| 2.x 3.00 4.00 4.00a 5.00 | 2.20 2.21 3.00 WINDOWS                 | OS/2 kbusage The information in this article applies to:
 * width="100%"|


 * Microsoft Excel for Windows, versions 2.x, 3.0, 4.0, 4.0a, 5.0
 * Microsoft Excel for OS/2 versions 2.2, 2.21, and 3.0

SUMMARY
To select a cell that contains a certain filename in a macro and have the macro automatically open the file that is listed in the selected cell, use the following macro line:

=OPEN(DEREF(cell reference)) The OPEN command requires that a full path be included to the file that is to be opened. Therefore, if the file is not in the current directory, you must include a complete path to the file that is listed in the cell of the worksheet. The following are examples:   In Cell A1, if the file is in the current directory, enter the following in Cell A1: filename.xls   In Cell A1, if the file is in another directory, enter the following in Cell A1: c:\windows\taxes\filename.xls 

MORE INFORMATION
It is recommended to include the complete path as noted in Example 2 in all cases.

Include the following in the macro:

=OPEN(DEREF(sheet1!$A$1))
 * }

-

Last reviewed: November 4, 1994

© 1998 Microsoft Corporation. All rights reserved. Terms of Use.