View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
BrianB BrianB is offline
external usenet poster
 
Posts: 1
Default Plot where mouse clicks


I think it is the old story where you have got so far and need mor
information for the next step.

I have done some work with this - mainly getting data from extrna
applictions. I think that, where you are at the moment, you have d
recognise that mouse co-ordinates can relate to the full monitor scree
or the active window, and Excel VBA co-ordinates probably relate t
neither. I remember somewhere seeing some calculations to convert mous
pixel co-ordinates to "mickeys". I remember getting problems if th
user did not have the application window maximised - when it could b
any size.

Here isa bit of Excel code, which I see relates screen co-ordinates 0,
to the top left of cell A1. The Height is the same as Row Height bu
Width is NOT the same as Cell Width.

'---------------------------------------------------------------------------
Sub GET_CELL_POSITION()
ActiveCell.Offset(0, 1).Value = ActiveCell.Address & " Top : "
ActiveCell.Top & " Points."
ActiveCell.Offset(1, 1).Value = ActiveCell.Address & " Left : "
ActiveCell.Left & " Points."
ActiveCell.Offset(2, 1).Value = ActiveCell.Address & " Height : "
ActiveCell.Height & " Points."
ActiveCell.Offset(3, 1).Value = ActiveCell.Address & " Width : "
ActiveCell.Width & " Points."
End Sub
'-------------------------------------------------------------------------

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com