Microsoft KB Archive/30824

{| = Excel: Opening a Worksheet As Read Only from a Macro =
 * width="100%"|

Last reviewed: October 31, 1994

Article ID: Q30824

SUMMARY
The Excel OPEN function has an optional third argument that is not documented in Excel versions 1.06 and earlier. This argument specifies whether or not the file is to be opened as read only.

The following code will open the file &quot;Example&quot; as read only:

=OPEN(&quot;Example&quot;,TRUE,TRUE) The following code will open the file &quot;Example&quot; as not read only: =OPEN(&quot;Example&quot;,TRUE,FALSE) If the third argument is omitted, Excel will open the document without selecting the read-only option. The complete format for the OPEN statement is as follows, where &quot;filename&quot; is the name of the file to be opened and &quot;update&quot; is either TRUE (update references to nonresident worksheets) or FALSE (do not update references):

=OPEN(filename,update,readonly)
 * }