Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Problem activating OLEObjects

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Problem activating OLEObjects

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 :

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

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
Activating Worksheet Controls - "Excel VBA Problem" vinayd Excel Programming 5 June 23rd 04 09:43 AM
Taking over OLEObjects... Possible ?! Alex T Excel Programming 4 June 16th 04 11:02 AM
OLEObjects clickable? Erich Neuwirth Excel Programming 1 June 8th 04 04:27 AM
Problem activating a sheet jowatkins[_6_] Excel Programming 1 January 19th 04 01:33 PM
Problem in activating a sheet Neeleshwar Thakur Excel Programming 1 December 18th 03 12:43 PM


All times are GMT +1. The time now is 02:15 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"