Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Getting reference to an OLEObject from another cell?


I wonder if a cell can contain a property value of an OLEObject in
another cell?

Assume i have two columns,the first contains OLEObject the second
should contains

OLEObject.Object.Caption


Thanks in advance.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Getting reference to an OLEObject from another cell?

This works, but you should add error handling:

Public Function GetOLEProp(OLEName As String) As String
GetOLEProp = Application.Caller.Parent.OLEObjects(OLEName).Obje ct.Caption
End Function

NickHK

wrote in message
oups.com...

I wonder if a cell can contain a property value of an OLEObject in
another cell?

Assume i have two columns,the first contains OLEObject the second
should contains

OLEObject.Object.Caption


Thanks in advance.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Getting reference to an OLEObject from another cell?

On Apr 23, 6:18 am, "NickHK" wrote:
This works, but you should add error handling:

Public Function GetOLEProp(OLEName As String) As String
GetOLEProp = Application.Caller.Parent.OLEObjects(OLEName).Obje ct.Caption
End Function

NickHK

wrote in message

oups.com...





I wonder if a cell can contain a property value of an OLEObject in
another cell?


Assume i have two columns,the first contains OLEObject the second
should contains


OLEObject.Object.Caption


Thanks in advance.- Hide quoted text -


- Show quoted text -


Thanks it is working...almost...the cell wouldn't update when i am
changing the caption.

Can i force recalculation of a range?

Thanks in advance.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Getting reference to an OLEObject from another cell?

Changing the caption from the properties does not result in a recalculation.
If you are doing it in code, you can call one of the .Calculate methods and
add the .Volatile in the function

Public Function GetOLEProp(OLEName As String) As String
Application.Volatile
GetOLEProp = Application.Caller.Parent.OLEObjects(OLEName).Obje ct.Caption
End Function

NickHK

wrote in message
ups.com...
On Apr 23, 6:18 am, "NickHK" wrote:
This works, but you should add error handling:

Public Function GetOLEProp(OLEName As String) As String
GetOLEProp =

Application.Caller.Parent.OLEObjects(OLEName).Obje ct.Caption
End Function

NickHK

wrote in message

oups.com...





I wonder if a cell can contain a property value of an OLEObject in
another cell?


Assume i have two columns,the first contains OLEObject the second
should contains


OLEObject.Object.Caption


Thanks in advance.- Hide quoted text -


- Show quoted text -


Thanks it is working...almost...the cell wouldn't update when i am
changing the caption.

Can i force recalculation of a range?

Thanks in advance.



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
OleObject really embedded in cell - not as shape overlay Jon Peltier Excel Programming 1 December 20th 06 01:40 PM
OLEObject question Bragadiru Excel Programming 0 March 15th 05 04:17 PM
FollowHyperlink to OLEObject Tony Excel Programming 0 January 5th 05 10:15 PM
Reference oleobject within shape group Andrew[_16_] Excel Programming 4 December 24th 03 02:31 AM
OLEobject on the sheet Ryan[_6_] Excel Programming 1 August 3rd 03 03:15 PM


All times are GMT +1. The time now is 07:16 PM.

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"