The information in this article applies to:
SYMPTOMSWhen a UserForm has more than 411 controls and any controls added after the 411th are addressed directly by name in a Microsoft Visual Basic for Applications macro or procedure (for example, UserForm1.Label412), you receive one of the following error messages. In Microsoft Windows 95If you click Details, you receive an error message similar to the following:
-or- In Microsoft Powerpoint, you receive the following error message:
In Microsoft Windows NTDr. Watson for Windows NT
-or-
CAUSEThis behavior occurs when 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.aspControls beyond the 411th control must be addressed as a member of the Controls collection instead of addressed by name directly. You can use one of the following methods to work around the problem. Method 1: Using a For Each...Next StatementRefer to the desired control using the Controls collection and a For Each...Next statement. The following sample Sub procedure demonstrates this method:
Method 2: Using the Item MethodUse the Item method with the index number as the following sample Visual Basic statements demonstrate:
-or-
-or-
NOTE: The index starts at 0.
STATUSMicrosoft has confirmed this to be a problem in the products listed above. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available. MORE INFORMATIONDeleting a control with a TabIndex property number less than 411 allows the next named control above the previous 410 to be addressed without error, but the error then occurs on the control that becomes the 411th after the deletion. Changing the TabOrder property or TabIndex property number of a control does not change the behavior; the behavior seems to be entirely determined by the order in which the controls were created. REFERENCESFor additional information about getting help with Visual Basic for Applications, please see the following article in the Microsoft Knowledge Base: Q163435 VBA: Programming Resources for Visual Basic for Applications Additional query words: XL97 8.0 form custom dialog box vbe
Keywords : kbcode kbprg OffVBA |
Last Reviewed: November 13, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |