Macros and Hotkeys

  • Thread starter Thread starter Christopher Weaver
  • Start date Start date
C

Christopher Weaver

The following code works fine when invoked with alt-f8, etc. But when I
assign a hotkey via the options dialog box and attempt to invoke it using
that hotkey, the last line is not executed or does not work. The comment is
created, and it is blank, but the user is not taken into the edit mode of
the comment. Any ideas?


Dim cmt As Comment
Set cmt = ActiveCell.Comment
If cmt Is Nothing Then
ActiveCell.AddComment Text:=""
End If
SendKeys "%ie~"
 
Adding a slight delay worked ok for me:

Dim cmt As Comment
Set cmt = ActiveCell.Comment
If cmt Is Nothing Then
ActiveCell.AddComment Text:=""
End If
Application.Wait Now + TimeSerial(0, 0, 1)
SendKeys "%ie~"
 
Thank you, that works for me, as well.


Dave Peterson said:
Adding a slight delay worked ok for me:

Dim cmt As Comment
Set cmt = ActiveCell.Comment
If cmt Is Nothing Then
ActiveCell.AddComment Text:=""
End If
Application.Wait Now + TimeSerial(0, 0, 1)
SendKeys "%ie~"
 
Back
Top