LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Taking over OLEObjects... Possible ?!

Folks

Any chance to have the following code running ?

1. --- Class module

Option Explicit

Public WithEvents myObj As Excel.OLEObject

Private Sub myObj_GotFocus()

MsgBox "focus"

End Sub

2. --- Module

Option Explicit

Dim myButtons() As New clsMyOLEObj


Sub doStuff()

Dim x As OLEObject
Dim numItems As Integer


numItems = 0
For Each x In ActiveSheet.OLEObjects

numItems = numItems + 1
ReDim Preserve myButtons(1 To numItems)
Set myButtons(numItems).myObj = x

Next x

End Sub

The idea is to "take over" the OLEObjects and have one centralized
processing.

I'm doing (as per John Walkenbach
http://j-walk.com/ss/excel/tips/tip44.htm ) similar things with
userforms controls and it works well. However my code above fails when
assigning to myButtons(numItems).

Any idea ?


Thanks & regards

--AlexT
 
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
OLEObjects clickable? Erich Neuwirth Excel Programming 1 June 8th 04 04:27 AM
Glolbal Variables Reset when using OleObjects Rock Excel Programming 11 May 31st 04 03:00 AM
Assigning click event to OleObjects checkbox Jim McLeod Excel Programming 5 April 20th 04 07:02 PM
Referring to OLEObjects (combobox's on worksheet) Ian Chappel[_2_] Excel Programming 4 September 22nd 03 05:31 PM


All times are GMT +1. The time now is 07:13 AM.

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

About Us

"It's about Microsoft Excel"