The information in this article applies to:
SYMPTOMSWhen you run a Microsoft Visual Basic for Applications subroutine in Microsoft Excel, you may receive the following macro error message: This error will occur if the following conditions are true:
-and- CAUSETo change the text of an edit box on a protected dialog sheet, the Lock Text check box must be cleared. The Lock Text check box is located on the Protection tab of the Format Object dialog box for that edit box. When the file is saved, closed, and reopened, the Lock Text check box is reset. 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 change the Text property of an edit box using a Visual Basic for Applications subroutine, use one of the following methods. Method 1Unprotect the dialog sheet before you change the edit box text and then reprotect the dialog sheet. The following example uses the Unprotect method to unprotect a dialog sheet named "Dialog1." It then changes the text of an edit box named "Edit Box 4," and then reprotects the Dialog Sheet.
Method 2Leave the dialog sheet unprotected.STATUSMicrosoft has confirmed this to be a problem in versions of Microsoft Excel listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available. REFERENCESFor more information about the Text Property, choose the Search button in Visual Basic Reference help and type: Text PropertyFor additional information, please see the following articles in the Microsoft Knowledge Base: Q113599 Can't Format Control Text in Objects Such As EditBox and Range Q125422 XL5: Creating a Masked Password Dialog Box in Visual Basic Additional query words: editbox dialogsheet checkbox
Keywords : kbcode kberrmsg kbprg PgmOthr |
Last Reviewed: November 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |