Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
When I move my cursor over a cell containing a comment, the comment pops up.
Can I trap this event? -- Gary's Student |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Nope. There is no Mouse Over event in Excel. There is in buttons and such but
not in cells which is what you are looking for. -- HTH... Jim Thomlinson "Gary''s Student" wrote: When I move my cursor over a cell containing a comment, the comment pops up. Can I trap this event? -- Gary's Student |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you for your fast response. This is just another example of knowledge
not bringing happiness. -- Gary's Student "Jim Thomlinson" wrote: Nope. There is no Mouse Over event in Excel. There is in buttons and such but not in cells which is what you are looking for. -- HTH... Jim Thomlinson "Gary''s Student" wrote: When I move my cursor over a cell containing a comment, the comment pops up. Can I trap this event? -- Gary's Student |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
For built in capabilities of Excel, this is not supported.
-- Regards, Tom Ogilvy "Gary''s Student" wrote in message ... When I move my cursor over a cell containing a comment, the comment pops up. Can I trap this event? -- Gary's Student |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can I trap this event?
Yes. The following code belongs in a standard module. Run the StartTimer sub to start monitoring. Run the StopTimer sub to turn turn it off. Regards, Vic Eldridge Declare Function SetTimer Lib "user32" _ (ByVal hwnd As Long, _ ByVal nIDEvent As Long, _ ByVal uElapse As Long, _ ByVal lpTimerFunc As Long) As Long Declare Function KillTimer Lib "user32" _ (ByVal hwnd As Long, _ ByVal nIDEvent As Long) As Long Declare Function GetCursorPos Lib "user32" _ (lpPoint As POINTAPI) As Long Type POINTAPI x As Long Y As Long End Type Dim TimerOn As Boolean Dim TimerId As Long Sub StartTimer() If Not TimerOn Then TimerId = SetTimer(0, 0, 0.01, AddressOf TimerProc) TimerOn = True Else MsgBox "Timer already On !", vbInformation End If End Sub Sub StopTimer() If TimerOn Then KillTimer 0, TimerId TimerOn = False Else MsgBox "Timer already Off", vbInformation End If End Sub Sub TimerProc() Dim CursorPos As POINTAPI Dim ThisObject As Object On Error Resume Next GetCursorPos CursorPos Set ThisObject = ActiveWindow.RangeFromPoint(CursorPos.x, CursorPos.Y) If TypeName(ThisObject) = "Range" Then If Not ThisObject.Comment Is Nothing Then StopTimer MsgBox "Cell " & ThisObject.Address & " has the following comment," _ & vbCrLf & ThisObject.Comment.Text StartTimer End If End If End Sub |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Vic
Good code but any chance you know how to check for muse over event on a cell ie: when over a range the cursor changes (similar to what happens on a browser for a clickable item / hyperlnk) Best if this can be in .net (add-in or dll) Any help / guidence appreciated. Thanks "Vic Eldridge" wrote: Can I trap this event? Yes. The following code belongs in a standard module. Run the StartTimer sub to start monitoring. Run the StopTimer sub to turn turn it off. Regards, Vic Eldridge Declare Function SetTimer Lib "user32" _ (ByVal hwnd As Long, _ ByVal nIDEvent As Long, _ ByVal uElapse As Long, _ ByVal lpTimerFunc As Long) As Long Declare Function KillTimer Lib "user32" _ (ByVal hwnd As Long, _ ByVal nIDEvent As Long) As Long Declare Function GetCursorPos Lib "user32" _ (lpPoint As POINTAPI) As Long Type POINTAPI x As Long Y As Long End Type Dim TimerOn As Boolean Dim TimerId As Long Sub StartTimer() If Not TimerOn Then TimerId = SetTimer(0, 0, 0.01, AddressOf TimerProc) TimerOn = True Else MsgBox "Timer already On !", vbInformation End If End Sub Sub StopTimer() If TimerOn Then KillTimer 0, TimerId TimerOn = False Else MsgBox "Timer already Off", vbInformation End If End Sub Sub TimerProc() Dim CursorPos As POINTAPI Dim ThisObject As Object On Error Resume Next GetCursorPos CursorPos Set ThisObject = ActiveWindow.RangeFromPoint(CursorPos.x, CursorPos.Y) If TypeName(ThisObject) = "Range" Then If Not ThisObject.Comment Is Nothing Then StopTimer MsgBox "Cell " & ThisObject.Address & " has the following comment," _ & vbCrLf & ThisObject.Comment.Text StartTimer End If End If End Sub |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Perhaps the following code will shed some light. Unfortunately though, I
don't know of a way to get Excel to show the "hand" cursor. Regards, Vic Eldridge Declare Function SetTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long Declare Function KillTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long) As Long Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long Type POINTAPI X As Long Y As Long End Type Dim MousePos As POINTAPI Dim TimerOn As Boolean Dim TimerId As Long Sub StartTimer() If Not TimerOn Then TimerId = SetTimer(0, 0, 0.01, AddressOf TimerProc) TimerOn = True Else MsgBox "Timer already On !", vbInformation End If End Sub Sub TimerProc() On Error Resume Next GetCursorPos MousePos Application.StatusBar = ActiveWindow.RangeFromPoint(MousePos.X, MousePos.Y).Address End Sub Sub StopTimer() If TimerOn Then KillTimer 0, TimerId TimerOn = False Else MsgBox "Timer already Off", vbInformation End If End Sub "gavins_satori" wrote: Vic Good code but any chance you know how to check for muse over event on a cell ie: when over a range the cursor changes (similar to what happens on a browser for a clickable item / hyperlnk) Best if this can be in .net (add-in or dll) Any help / guidence appreciated. Thanks "Vic Eldridge" wrote: Can I trap this event? Yes. The following code belongs in a standard module. Run the StartTimer sub to start monitoring. Run the StopTimer sub to turn turn it off. Regards, Vic Eldridge Declare Function SetTimer Lib "user32" _ (ByVal hwnd As Long, _ ByVal nIDEvent As Long, _ ByVal uElapse As Long, _ ByVal lpTimerFunc As Long) As Long Declare Function KillTimer Lib "user32" _ (ByVal hwnd As Long, _ ByVal nIDEvent As Long) As Long Declare Function GetCursorPos Lib "user32" _ (lpPoint As POINTAPI) As Long Type POINTAPI x As Long Y As Long End Type Dim TimerOn As Boolean Dim TimerId As Long Sub StartTimer() If Not TimerOn Then TimerId = SetTimer(0, 0, 0.01, AddressOf TimerProc) TimerOn = True Else MsgBox "Timer already On !", vbInformation End If End Sub Sub StopTimer() If TimerOn Then KillTimer 0, TimerId TimerOn = False Else MsgBox "Timer already Off", vbInformation End If End Sub Sub TimerProc() Dim CursorPos As POINTAPI Dim ThisObject As Object On Error Resume Next GetCursorPos CursorPos Set ThisObject = ActiveWindow.RangeFromPoint(CursorPos.x, CursorPos.Y) If TypeName(ThisObject) = "Range" Then If Not ThisObject.Comment Is Nothing Then StopTimer MsgBox "Cell " & ThisObject.Address & " has the following comment," _ & vbCrLf & ThisObject.Comment.Text StartTimer End If End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
My cursor always in selection mode,wat about other cursor option | Excel Discussion (Misc queries) | |||
move cursor on one sheet moves cursor on all sheets | Excel Discussion (Misc queries) | |||
Move the cursor to a cell in button click event | Excel Programming | |||
Can I change the "white cross" cursor in Excel to another cursor? | Excel Discussion (Misc queries) | |||
I want to add a sound event when the cursor bumps left margin | Excel Discussion (Misc queries) |