I'm getting reports of VBA "Run-time error '1004': Method 'OnKey' of object '_Application' failed" at least on Excel 2016 under Windows in this code:
Private Sub Workbook_Deactivate()
Application.OnKey "^x"
End Sub
(The code overrides certain hotkeys when my VBA-enabled workbook is active, and restores the default behavior when the user switches back to another workbook.)
What could be the reason?