My system is 32 bit.

I have almost exactly what you show in the first code, except for >

"Private" in front of "Declare Function", and "lpWindowName As String" instead of "lpWindowName As Long"

I also have this statement >

Private Declare Function GetKeyboardState Lib "user32" (pbKeyState As Byte) As Long

Note that I don't really understand most of this. Years ago (with Excel 2003 and an earlier OS) I pasted a question in a forum like this, got an answer, and with adaptations for the App names I had and the entries I wanted to make, it worked.

That being said, I will try pasting in the "more robust" code, see what happens, and report back.