Great code here ^^

This code in some cases will open a Modal menu and Excel (for example) will keep waiting for the Adobe Menu to be closed before continuing. Changing to PostMessage opens the menu and continues the code.

You could add:
Code:
Private Declare PtrSafe Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal Hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
and change to:
Code:
L = PostMessage(Hwnd, WM_COMMAND, M.wID, ByVal 0)
(thanks)