Excel: Opening Documents Not in Current Folder from MacroLast reviewed: October 31, 1994Article ID: Q47586 |
SUMMARYOPEN() is a macro function to open Excel files. OPEN() defaults to opening files within the current folder. To open a file outside of the current folder, you can use one of the two following methods:
MORE INFORMATIONFor example, if you want to open a file called "Worksheet1" in the folder "Expenses" on the hard drive "Hard Disk", the OPEN() function would be as follows:
=OPEN("Hard Disk:Expenses:Worksheet1")In Excel 1.50 and later, you can use the DIRECTORY() function to achieve the same results, as follows:
=DIRECTORY("Hard Disk:Expenses") =OPEN("Worksheet1")The DIRECTORY() function in Excel 1.50 and later changes the current folder. If you want to open a file in another folder but not change the current folder, use the first method. The second method should be used if you want to change the current folder. For more information, see page 213 for DIRECTORY() and page 254 for OPEN() in the "Microsoft Excel Functions and Macros" manual for version 2.20, or page 224 for DIRECTORY() and page 250 for OPEN() in the "Microsoft Excel Arrays, Functions, and Macros" manual for version 1.50.
|
KBCategory: kbother
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |