Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, All!
I have a Container with two tabs (two different tables inside). How could I using macro select one tab or another (accordingly user will see one table or another)?
Thanks.
up
Hi,
As per my understanding u need to display the tables(Charts) as per buttons click or sheet activate using some buttons.
I m sending the solution for the both please refer the attached qve application. and revert me back for any clarifications.
Thanks
Manesh
Hi, Manesh
Thanks. But I want that these tables are placed in the Container (please, see attach). If we click of first button - first tab will be displayed, second button - second tab will be displayed. Could you advice?
Thanks.
Hi,
Please refer the attached application.
Sheet1 --Press -- Display Sheet1
Sheet2--Press - Display sheet2
Revert for issue.
Manesh, I should use Container. Where is Container in your example?
Hi Maxim,
I haven't tried this yet, but API 11 has this example
Set ContainerObj = ActiveDocument.GetSheetObject("CT01")
set ContProp=ContainerObj.GetProperties
ActiveObject=ContProp.SingleObjectActiveIndex
msgbox("Active Object=" & ActiveObject & " Id=" & ContProp.ContainedObjects.Item(ActiveObject).Id)
and property SingleObjectActiveIndex is described as read-write.
So you may try to assign to this property Id of one or another container object.
Did anyone get this working please?
I need to activate an object within a container via a button.
I have just tried a solution for the very same purpose and it has worked properly. Please find the sample code below. You can write as many copies of the same subprocedure as you need, by changing the name of the sub and the value of the MV_ActiveIndex variable so that you can attach each sub to a button, enabling your macros to be run when clicked on the relevant buttons.
Hope this helps.
Regards,
sub ContTabSelect0
set MV_ContainerObj = ActiveDocument.GetSheetObject("CT13")
Set MV_ContProp = MV_ContainerObj.GetProperties
MV_ActiveIndex2 = MV_ContProp.SingleObjectActiveIndex
MV_ActiveIndex2 = 0
MV_ContProp.SingleObjectActiveIndex = MV_ActiveIndex2
MV_ContainerObj.SetProperties MV_ContProp
End Sub
Did you ever get this to work on a button?