• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 494
  • Last Modified:

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?
0
Datenkultur
Asked:
Datenkultur
  • 2
1 Solution
 
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
 
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now