LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Mouse position within worksheet

Either I'm missing something or you've already got the information you need.
You say user clicks on the worksheet so presumably that activates a cell -
what more do you need than that. IOW why do you need the mouse coordinates
when you've already got the cell coordinates, which is what you will be
using to position your inserted shape.

Or, wondering, do you want the exact spot within some cell rather than say
the top/left cell coordinate.

Regards,
Peter T


"Andrew" wrote in message
...
Hi Peter,

Thanks for for the reply.

I have a series of buttons displayed on the Ribbon which should insert
a picture at a location selected by the user (by clicking on the
worksheet). I need to be able to translate the mouse location to the
appropriate sheet coordinates in order to insert the picture at the
right spot.

Thanks again,
Andrew





On 8 Feb, 15:21, "Peter T" <peter_t@discussions wrote:
That approach doesn't work in 2007+ as embedded charts are not windows in
they way they were in previous versions.

There are other ways of relating mouse coordinates to a cell address, or a
cell position to screen coordinates depending on the overall objective.

Regards,
Peter T

"Andrew" wrote in message

...



Some years ago I remember reading an approach for determining the
mouse position within a sheet. I believe this used the GetCursorPos
API to find the "absolute" mouse position relative to the window, then
inserted a dummy chart object in cell A1, set a handle to this and
then compared the coordinates of the chart to the mouse position to
determine its relative position on the sheet. I've spent about an
hour now searching for this code without success - does anyone have a
copy they could re-post?


Thanks a lot,
Andrew- Hide quoted text -


- Show quoted text -



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get position of mouse via VB in a worksheet ratty Excel Programming 2 January 30th 09 09:28 AM
Mouse Position Jason Zischke Excel Programming 1 May 21st 07 06:39 AM
Position of the mouse pointer Liam Excel Programming 5 October 26th 06 02:20 PM
Mouse Position Max Potters Excel Programming 3 September 28th 04 06:09 PM
position mouse cursor in msg box swatsp0p[_2_] Excel Programming 2 September 24th 04 07:12 AM


All times are GMT +1. The time now is 11:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"