Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 542
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
combo box in a user form juliejg1 Excel Programming 3 April 10th 06 09:15 PM
Can't seem to get Combo Box on User Form [email protected] Excel Programming 5 April 25th 05 11:15 AM
Currency format for combo box in a user form Jennifer Excel Programming 4 April 16th 05 06:16 AM
Patrick -- 424 Combo Box User Form Jennifer Excel Programming 2 April 8th 05 07:31 AM
Run Time Error 424 Combo Box User Form Jennifer Excel Programming 3 April 7th 05 08:23 PM


All times are GMT +1. The time now is 04:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"