Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi experts,
I would like to create a button that will restore ONLY the objects in the red box. Is anyone can help me.. the CH... are the object ID for each objects
With this macro script is restore all of the object include left hand side list box:
sub MaximizeAll
Objects = ActiveDocument.ActiveSheet.GetSheetObjects
For j = lBound(Objects) To uBound(Objects)
set obj = Objects(j)
obj.Restore
next
end sub
But i just want restore the object in the red box only. Is anyone can help me?
Thank you very much
if it is less objects, you can try like this..
sub MaximizeAll ()
ActiveDocument.GetSheetObject("CH01").Restore
ActiveDocument.GetSheetObject("CH02").Restore
ActiveDocument.GetSheetObject("CH03").Restore
end sub
if it is less objects, you can try like this..
sub MaximizeAll ()
ActiveDocument.GetSheetObject("CH01").Restore
ActiveDocument.GetSheetObject("CH02").Restore
ActiveDocument.GetSheetObject("CH03").Restore
end sub
Hello Jim,
You can also use button actions to minimize and maximize the objects like below. Sample attached for your reference.
Thanks settu,
it works for me...thanks you very much
Another way is to list out the Object ID which are needed to restore in inline table of the script
Objects:
LOAD * inline [
ObjectID
CH01
CH02
CH03 ];
you can take this object ID field in listbox on front end and note the objectID of listbox
Now use the macro like below
sub MaximizeAll
set LB = ActiveDocument.GetSheetObject("LB01")
boxvalues=LB.GetPossibleValues
for i = lbound(boxvalues) to ubound(boxvalues)
set obj = Objects(i)
obj.Restore
next
end sub
Even you can try this too.. with less code..
sub MaximizeAll ()
SheetObj=Array("CH01","CH02","CH03") ' Chart ID's here
for i=0 to UBound(SheetObj)
ActiveDocument.GetSheetObject(SheetObj(i)).Restore
Next
end sub