Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combo Box on User Form Question
I frequently have a problem with Excel crashing when running VBA code to open
an user form. The error message reads "Microsoft Office Excel has encountered a problem and needs to close" and requires termination of the program. This error also always happens when the VBA project is locked (i.e., if I enter the password to view the VBA code upon opening the workbook it never occurs.) Error trapping has shown that the problem takes place on the line of code that assigns an initial value to the combo box cboVSMName in the UserForm_Initialize event. Basically, the objective of this code is to fill the combo box with the value that was last selected by an user. Cell D100 is assigned the value of the combo box before unloading the user form. The UserForm_Initialize code is shown below. Private Sub UserForm_Initialize() Dim FillValue As String Call FillOtherCombos Call FillMapCombo FillValue = Sheets("Entry Sheet").Range("D100").Value cboVSMName.Value = FillValue End Sub It may also be worth noting that there is a Change event tied to cboVSMName that changes the value of some text boxes on the form whenever a different selection in the combo box is made. Does anybody have some ideas of why this may be happening or have some suggestions on how I can modify the code to prevent this from happening? More specifically, is there a more intelligent way than what I have done to assign the starting value of a combo box to the last item selected before the form was unloaded when initializing a form? Thanks, James |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combo Box on User Form Question
recompile code
-- Atte. ?T Francisco T? http://groups.msn.com/ExcelVbaMacrosOffice El verdadero buscador crece y aprende, y descubre que siempre es el principal responsable de lo que sucede. Jorge Bucay La oscuridad nos envuelve a todos, pero mientras el sabio tropieza en alguna pared, el ignorante permanece tranquilo en el centro de la estancia. Anatole France |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
combo box in a user form | Excel Programming | |||
Can't seem to get Combo Box on User Form | Excel Programming | |||
Currency format for combo box in a user form | Excel Programming | |||
Patrick -- 424 Combo Box User Form | Excel Programming | |||
Run Time Error 424 Combo Box User Form | Excel Programming |