How to get an Excel cell by Mouseposition

Hi all,

I try to get a cell (Excel.Range-Object), but I won't click the cell. The spreadsheet is activated and I have the coordinates of the mouse-position.

Is there a way to get the cell direct under the mouse position?
DatenkulturAsked:
Who is Participating?
 
DatenkulturAuthor Commented:
I got a solution:

I can select the cell by sending a simple mouseclick. But it will only work, if you change the mouseposition by code before.

I did not tell, that I tried to select a cell behind a chart-object by clicking the chart-object. So excel selects the chart first. After that, i killed the chart and tried to select the cell under the actual mousepointer. Sending a mouseclick allways selected the old cell. After changing the mouseposition by code a little it worked. I think excel was looking for a mouse move, in oder to select another cell by click.

0
 
DatenkulturAuthor Commented:
Thanks for your post, itkamaraj.

I can't change the spreadsheet. I have a reference of the activesheet and I can use every event, but I have to find the cell without changing the map.

I would like to select the cell unter the mousepointer without a user mouseclick.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.