XL98: System Error Using DropDown Method with ComboBoxLast reviewed: March 18, 1998Article ID: Q182698 |
The information in this article applies to:
SYMPTOMSWhen you use the DropDown method in a Visual Basic for Applications procedure to display the list of a ComboBox, you may receive one of the following error messages
The application "Microsoft Excel" has unexpectedly quit, because an error of type 1 occurred. You should save your work in other open applications and restart the computer. -or- Sorry, a system error occurred. "Microsoft Excel" error type 11and then Microsoft Excel quits.
CAUSEThis problem occurs when the following conditions are true:
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 engineers 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/refguide/default.aspThe following example illustrates how to display the list of one ComboBox control when you make a choice in the list of another ComboBox control on a UserForm:
1. Close and save any open workbooks. Then, open a new workbook. 2. On Sheet1, enter the following values: A1: Planes C1: Alpha A2: Trains C2: Bravo A3: Automobiles C3: Charlie 3. Start the Visual Basic Editor, (press OPTION+F11). 4. On the Insert menu, click Module. 5. In the Code window for the module, type the following procedure: Sub DropDown_ComboBox() UserForm1.ComboBox2.DropDown End Sub 6. On the Insert menu, click UserForm. 7. Draw two ComboBox controls on the UserForm. 8. Double-click the UserForm to open the Code window for the UserForm. 9. In the module, type the following code: Private Sub UserForm_Initialize() ' Populate ComboBox1. ComboBox1.List = Worksheets("Sheet1").Range("A1:A3").Value ' Populate ComboBox2. ComboBox2.List = Worksheets("Sheet1").Range("C1:C3").Value End Sub Private Sub ComboBox1_Click() Application.OnTime Now, "DropDown_ComboBox" End Sub 10. Run the UserForm.When you click an item in the list of ComboBox1, the list for ComboBox2 is automatically displayed.
STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.
REFERENCESFor more information about using the ComboBox control, click the Office Assistant in the Visual Basic Editor, type "combobox control" (without the quotation marks), click Search, and then click to view the "ComboBox Control" topic. For more information about using the DropDown method, click the Office Assistant in the Visual Basic Editor, type "dropdown method" (without the quotation marks), click Search, and then click to view the "DropDown Method" topic. NOTE: If the Assistant is hidden, click the Office Assistant button on the Standard toolbar. If Microsoft Help is not installed on your computer, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q179216 TITLE : OFF98: How to Use the Microsoft Office Installer Program |
Additional query words: XL98 combo box drop down
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |