XL98: System Error Using DropDown Method with ComboBox (182698)



The information in this article applies to:

  • Microsoft Excel 98 Macintosh Edition

This article was previously published under Q182698

SYMPTOMS

When 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 11
and then Microsoft Excel quits.

CAUSE

This problem occurs when the following conditions are true:
  • You have a Visual Basic procedure attached to the Click event or the Change event of a ComboBox control in a UserForm. -and-

  • The Visual Basic procedure attempts to set the focus to, and then display the list of, another ComboBox control on the UserForm.

WORKAROUND

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to 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 requirements. The 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.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.

MORE INFORMATION

REFERENCES

For more information about using the ComboBox control, click the Office Assistant in the Visual Basic Editor, type combobox control, 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, 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:

179216 OFF98: How to Use the Microsoft Office Installer Program


Modification Type:MajorLast Reviewed:6/17/2005
Keywords:kbbug kbdtacode kberrmsg kbnofix kbProgramming KB182698