can a userform be a child object of a chart

bigt95nt

New Member
Joined
Apr 11, 2011
Messages
26
Below are two class methods. The first creates a shape on the chart. The second creates a simple userform. The second method is called from within the first.

Once the "ovlPointer" is created it acts like a "child object" .ie when you move the "ovlPointer" it is constrained by the chart boundries; however, when the userform is created it is outside of the chart boundries and seems to be independent of the chart.

Please comment

Thanks,
Tony

PHP:
Private Sub mchtChart_Activate()
'
Dim tt As Object
Set tt = ActiveChart.Shapes.AddShape(msoShapeOval, 25, 25, 20, 20)
tt.Name = "ovlPointer"
Me.mchtChart.Shapes.Range(Array("ovlPointer")).Fill.Transparency = 1
 
Call LegendControl2(Me)
End Sub
 
Sub LegendControl2(oChart As CChart)
 
With UserForm1
    .Left = oChart.mchtChart.Legend.Left
    .Top = oChart.mchtChart.Legend.Top
    .Width = 100
    .Height = newControls.Count * 20 + 1
End With
UserForm1.Show
End Sub
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Userforms are not and cannot be embedded into sheets and their coordinate system is not the same as objects on sheets.
 
Upvote 0
If a form can not be inbeded into a chart then is it possible to inbed individual controls?
Thanks, Tony
 
Upvote 0
You can add Forms controls (much the same as you do with shapes) but not Activex ones.
 
Upvote 0

Forum statistics

Threads
1,224,574
Messages
6,179,633
Members
452,933
Latest member
patv

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top