Excel: Password in PROTECT.DOCUMENT() Returns Macro Error

Last reviewed: November 29, 1994
Article ID: Q58232
The information in this article applies to:
  • Microsoft Excel for the Macintosh, versions 2.2, 3.0, 4.0

PROTECT.DOCUMENT() is a Microsoft Excel macro command that allows you to protect a document or chart with or without a password.

To protect a document with a password, the password argument must be surrounded by double quotation marks (""). If there are no quotation marks around the password, Excel returns a macro error. This occurs because any text not surrounded by quotation marks that is passed as an argument to any Excel function is assumed to be a defined name.


KBCategory: kbusage
KBSubcategory:

Additional reference words: 2.20 2.2 3.00 3.0 4.00 4.0


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 29, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.