I am unable to run macro from Application.Onkey option. The following message is displayed upon pressing TAB key: "Cannot run the macro "C:\...\Desktop\test.xlsm!abc'. The macro may not be available in this workbook or all macros may be disabled."
However, upon pressing Enter key, selection goes 1 row below (as it always does) instead of running the same macro.
I have enabled all macros from Trust Settings and checked "Trust access to the VBA project object model". The file have been saved with xlsm extension. All of the following macros are in thisWorkbook:
Private Sub Workbook_Open()
Test1
End Sub
Sub Test1()
Application.OnKey "{TAB}", "abc"
Application.OnKey "{ENTER}", "abc"
End Sub
Sub abc()
MsgBox "TAB"
End Sub
Can anyone help me with this one?