Hello all!!!
I have a trouble. I have Excel document, which contains some shapes and i needed to get Excel union in next format: "Address of the top left cell of the range which includes the shapes: Address of the right bottom cell of the range which includes the shapes". I have next code for this:
but it's return a string, which contains list of ranges- for example : "$A$1:$C$7,$C$8:$E$12,$F$4:$G$9,$J$11:$K$15".
I have a trouble. I have Excel document, which contains some shapes and i needed to get Excel union in next format: "Address of the top left cell of the range which includes the shapes: Address of the right bottom cell of the range which includes the shapes". I have next code for this:
Code:
on GET_FULL_USED_RANGE(wbId, wsId)
tell app "Microsoft Excel"
set ws to sheet wsId of workbook wbId
set ur to used range of ws
repeat with i from 1 to (count shapes of ws)
set so to shape i of ws
set tlc to get address of top left cell of so
set brc to get address of bottom right cell of so
set shpRng to range (tlc & ":" & brc) of ws
set ur to union range1 ur range2 shpRng
end repeat
return get address (range (get address ur) of ws)
end tell
end GET_FULL_USED_RANGE