That will get the inserted drawing, not the block within it, unless I'm misunderstanding how this is all set up. That's how the OP's original code led me.
If the drawing is the block then the explode would leave an exploded titke block, but with no drawing supplied it's difficult to figure out.
This link talks about using excel to get the answer you want you may be able to get Autocad to run the command. and return the values. I Know you can do stuff like set cell color.
https://exceljet.net/formula/last-row-number-in-range
for column A
=LOOKUP(2,1/(A:A<>""),ROW(A:A))