Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Refer to a control inserted in chart

I have inserted a checkBox in a chart. I need to refer to it programatically,
buy I must not use the control's name, because I plan to copy-paste the sheet
(chart is embedde on it) many times, and control (two checkboxes and one
command button) names change.

I have tried to search it by type (an later by 'caption' -it doesnt change
through copy-paste), in OLEObjects collection

For each obj in ActiveChart.OLEObjects

But ActiveCharts.OLEObjects is an empty collection for me.

Can you help me with this problem?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Refer to a control inserted in chart


Sub GetMeThere()
Dim obj As Shape
For Each obj In ActiveChart.Shapes
MsgBox obj.TextFrame.Characters.Caption 'or Text
Next
End Sub
--
No, it has never made a whole lot of sense to me either. <g

Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Francisco Gomez"
wrote in message
I have inserted a checkBox in a chart. I need to refer to it programatically,
buy I must not use the control's name, because I plan to copy-paste the sheet
(chart is embedde on it) many times, and control (two checkboxes and one
command button) names change.

I have tried to search it by type (an later by 'caption' -it doesnt change
through copy-paste), in OLEObjects collection

For each obj in ActiveChart.OLEObjects

But ActiveCharts.OLEObjects is an empty collection for me.

Can you help me with this problem?
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Refer to a control inserted in chart

THANK YOU! (I never expected a checkbox to be a shape... :) )

"Jim Cone" wrote:


Sub GetMeThere()
Dim obj As Shape
For Each obj In ActiveChart.Shapes
MsgBox obj.TextFrame.Characters.Caption 'or Text
Next
End Sub
--
No, it has never made a whole lot of sense to me either. <g

Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Francisco Gomez"
wrote in message
I have inserted a checkBox in a chart. I need to refer to it programatically,
buy I must not use the control's name, because I plan to copy-paste the sheet
(chart is embedde on it) many times, and control (two checkboxes and one
command button) names change.

I have tried to search it by type (an later by 'caption' -it doesnt change
through copy-paste), in OLEObjects collection

For each obj in ActiveChart.OLEObjects

But ActiveCharts.OLEObjects is an empty collection for me.

Can you help me with this problem?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Refer to a control inserted in chart

Another way:

Dim CBX As CheckBox
For Each CBX In ActiveChart.CheckBoxes
MsgBox CBX.Caption
Next CBX



Francisco Gomez wrote:

I have inserted a checkBox in a chart. I need to refer to it programatically,
buy I must not use the control's name, because I plan to copy-paste the sheet
(chart is embedde on it) many times, and control (two checkboxes and one
command button) names change.

I have tried to search it by type (an later by 'caption' -it doesnt change
through copy-paste), in OLEObjects collection

For each obj in ActiveChart.OLEObjects

But ActiveCharts.OLEObjects is an empty collection for me.

Can you help me with this problem?


--

Dave Peterson
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
Refer to control on userform from code module Dale Fye Excel Programming 1 September 6th 07 03:14 PM
A way refer to a control itself in an event handler clara Excel Programming 1 May 10th 07 08:59 PM
Refer to a control name from another sheet rezafloyd Excel Programming 1 October 10th 06 09:26 AM
.NET Custom Control not redrawing when inserted as OleObject in Excel [email protected] Excel Programming 0 July 21st 06 09:15 AM
Data pts do not show up in chart when inserted, Help? johnathan Charts and Charting in Excel 2 September 19th 05 05:38 AM


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