Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I want to implement a case where , on clik of one button, I want to display few charts, and change the Y coordinate of hidden charts to 1
then in second button, rest of the charts are displayed, first are hidden, and the positions that were reduced to 1 are bought back(reset), so that thay appear at the desired places.
I need this position changes in order to avoid the extra space that comes on the sheet because of the hidden objects.So, if I change the Y position to 1, the size of the sheet will corespond to only the objects that are visible.
Am using the macro below for capturing the Y position, but am not able to achieve this.
macro **************************************
sub hide1
dim reset_y(50)
dim objID(50)
dim Objects
Objects = ActiveDocument.ActiveSheet.GetSheetObjects()
for i = lbound(Objects) to ubound(Objects)
If Objects(i).GetObjectID()= CH37 Then
pos = Objects(i).GetRect
reset_y(i)=pos.Top
msgbox(reset_y(i))
objID=Objects(i).GetObjectID()
msgbox(objID(i))
end if
next
end sub
Please help me on this macro.
Hi,
Try this
sub test
dim reset_y(50)
dim objID(50)
dim Objects
Objects = ActiveDocument.ActiveSheet.GetSheetObjects()
for i = lbound(Objects) to ubound(Objects)
If Objects(i).GetObjectID() = "Document\CH01" Then
pos = Objects(i).GetRect
reset_y(i)=pos.Top
msgbox(reset_y(i))
objID(i)=Objects(i).GetObjectID()
msgbox(objID(i))
'msgbox Objects(i).GetObjectID()
end if
next
end sub
Regards,
Kaushik Solanki