SendKeys and/or Macro Failure (1 Viewer)

MarkK

bit cruncher
Local time
Today, 13:31
Joined
Mar 17, 2004
Messages
8,181
- I have this code in a standard module. I used to hit keys <Alt> <T> <M> <Enter> in any module, which ran this as if it was a macro and produced instant dated boxes to offset blocks of related routines.
- This has now stopped working in all my Access files. I can set a breakpoint and step through this code in a debugger. Everything appears to execute normally, but the keys are not sent to the active code window.
- Does anyone know how I can get this working again?
- Thanks in advance. Mark

Code:
Sub AA_SectionHeader()
   Dim i As Integer
   SendKeys _
"'******************************************************************** " & Chr(13) & _
"'*                                                                                                   " & Format(Date, "mmm d yyyy") & Chr(13) & _
"'*       >" & Chr(13) & _
"'*" & Chr(13) & _
"'********************************************************************" & Chr(13)
   For i = 1 To 3
      SendKeys "{UP}"
   Next i
   For i = 1 To 9
      SendKeys "{Right}"
   Next i
End Sub
 

Guus2005

AWF VIP
Local time
Today, 22:31
Joined
Jun 26, 2007
Messages
2,641
Code:
'********************************************************************
'*                                                         jun 27 2007
'*      X>
'*
'********************************************************************
I tried your code and the cursor blinks at the X.
Seems to work fine here.
 

MarkK

bit cruncher
Local time
Today, 13:31
Joined
Mar 17, 2004
Messages
8,181
I know, I know. I know what it's supposed to do. :mad: ;)
My SendKeys is still dead.
Thanks for trying it out.
Mark
 

MarkK

bit cruncher
Local time
Today, 13:31
Joined
Mar 17, 2004
Messages
8,181
Tried it. No go. Weirdest thing.
Why do you think DoEvents?
 

MarkK

bit cruncher
Local time
Today, 13:31
Joined
Mar 17, 2004
Messages
8,181
Solved. Rebooted. :eek: Which is what I tell other people to try first when strange problems happen to them.
Cheers,
Mark
 

Users who are viewing this thread

Top Bottom