Problem updating a ComboBox using VBA

  • Thread starter Thread starter Peter Fopma
  • Start date Start date
P

Peter Fopma

The Problem I am currently experiencing is that the update
of a combobox in an Excel-sheet occurs too late.

In the program I set the value property of a combobox in a
worksheet to various values and print the resulting sheet.
The data of the sheet is all updated correctly but the
display of the comboboxes is only updated the first time the
value property is set. Using ListIndex instead of Value
yields the same result. All change events etc. are called
correctly.

Is there a way to force an update for the display of a
combobox.

Thanks in advance
Peter Fopma
 
Hi Peter,

have you tried using the _afterupdate()
command for your combobox??

Thank you,

Robert Couchman
 
Hi Robert,

thanks for your reply, but I can only find a reference to the
AfterUpdate event. This will be triggered after the content
changed.

My code looks like this

sub print (values as collection)
for each val in collection
ActiveWorkbook.Sheets("SheetName").TheComboBox.Value = val
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
next
end sub

The first printout shows the expected value in the combobox. For
the other printouts Change events (even for the combobox) are called
and the sheet is updated but the ComboBox-display remains
unchanged. How should I use the AfterUpdate?

Thanks
Peter
 
Back
Top