The information in this article applies to:
SYMPTOMSWhen you use the Protect method in a Visual Basic for Applications macro to apply password protection to a worksheet, Microsoft Excel does not apply the password to the worksheet. CAUSEThis problem occurs when both of the following conditions are true:
-and- WORKAROUNDMicrosoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web: http://www.microsoft.com/support/supportnet/overview/overview.aspTo work around this problem, use either of the following methods. Method 1Use the ActiveSheet.Protect command only once and supply all the arguments, including the password. For example, use the following macro:
Method 2Set one of the Protect method arguments to False. To do this, use either of the following methods:
-or- STATUSMicrosoft has confirmed this to be a problem with the products listed at the beginning of this article. MORE INFORMATION
Microsoft Excel 98 Macintosh Edition allows you to add an additional layer
of protection by applying password protection to a previously protected
sheet. You can add this protection programmatically.
ExampleThe following sample code demonstrates the problem:
REFERENCES
For more information about protecting information, from the Visual Basic
Editor, click the Office Assistant, type Protect click Search, and then
click to view "Protect Method."
Q176476 OFF: Office Assistant Not Answering Visual Basic Questions Additional query words: XL98 vba
Keywords : kbprg kbdta kbdtacode xlvbainfo OffVBA xlmac |
Last Reviewed: November 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |