it doesn't work
Pitty.
But you not telling what exactly doesn't work isn't helping either.
The x/y lines I showed should work fine.
(you can put a Showmessage(x.tostring + ' ' + y.tostring); after them to see the values.)
Next you do something with UsedRange on ExcelApp (which isn't correct because you should use ExcelSheet).
And I'm not sure what this code is supposed to do.
The SpecialCells error message should be solved now (because you should have commented it out in favor of the x/y lines).