Macros and Hotkeys

  • Thread starter Christopher Weaver
  • 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~"
 
D

Dave Peterson

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~"
 
C

Christopher Weaver

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~"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top