Problem activating OLEObjects

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

Peter Fopma

On my Excel Worksheet I try to update ComboBoxes via
programm code.

Using the ListIndex attribute of the ComboBox does
not work - Updating is delayed until my subroutine exits.
Which is too late.

I found the possibility to call the Activate function
for all OLEObjects on the current Worksheet. The code
is simple an looks like this:

ActiveSheet.TextComboBox.value = "something"

For Each oleobj In ws.OLEObjects
oleobj.Activate
Next

This works fine for Excel 2000 and XP. But calling the
Activate function in Excel 97 causes an error:

"Die Activate-Methode des OLEObject-Objektes ist fehlerhaft."

in english, something like

"The activate Method of the OLEObject is faulty."

??? What? Why? I could not find a clue what this is supposed
to mean... I found references to an attribute TakeFocusOnClick
but I cannot find it in the OLEObject- or ComboBox-class.

Thanks for your help.

Peter Fopma
 
Peter,

it's not clear (to me) what exactly your trying to achieve?
or what the problem is..




activating/selecting them is generally counter productive.

If you set the listindex, remember that you trigger a few events..
depending on the eventhandlers you may have set for these controls
these WILL be handled. (or need to)
you may need to either disable events or include Doevetns for this
stuff to be handled correctly.


Or is the the screen that doesn't update?
(I've found that toggling the .visible property solves this best)






--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Peter Fopma wrote :
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top