Microsoft KB Archive/47586

{| = Excel: Opening Documents Not in Current Folder from Macro =
 * width="100%"|

Last reviewed: October 31, 1994

Article ID: Q47586

SUMMARY
OPEN 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:


 * 1) Include the directory path in the Open statement.
 * 2) Precede the OPEN function with the DIRECTORY function.

MORE INFORMATION
For example, if you want to open a file called &quot;Worksheet1&quot; in the folder &quot;Expenses&quot; on the hard drive &quot;Hard Disk&quot;, the OPEN function would be as follows:

=OPEN(&quot;Hard Disk:Expenses:Worksheet1&quot;) In Excel 1.50 and later, you can use the DIRECTORY function to achieve the same results, as follows: =DIRECTORY(&quot;Hard Disk:Expenses&quot;) =OPEN(&quot;Worksheet1&quot;) 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 &quot;Microsoft Excel Functions and Macros&quot; manual for version 2.20, or page 224 for DIRECTORY and page 250 for OPEN in the &quot;Microsoft Excel Arrays, Functions, and Macros&quot; manual for version 1.50.
 * }