Copy MS Excel 2019 VBA Selection To Named Clipboard Action Timeout Exceeded (v9.2)

The following macro action fails to copy the selected MS Excel 2019 VBA text while in the VBA editor with the following error message running Keyboard Maestro 9.2 on macOS 11.6:

2021-09-19 14:16:21 Execute macro “Copy MS Excel 2019 VBA Selection To Named Clipboard” from trigger The Hot Key F1 is pressed
2021-09-19 14:16:31 Action timeout exceeded.. Macro “Copy MS Excel 2019 VBA Selection To Named Clipboard” cancelled (while executing Copy to Named Clipboard “Clipboard_B”).

Copy MS Excel 2019 VBA Selection To Named Clipboard Action Timeout Exceeded Macro (v9.2)

Copy MS Excel 2019 VBA Selection To Named Clipboard Action Timeout Exceeded.kmmacros (1.6 KB)

Is this a permission issue? It may or may not be related, but neither my Keyboard Macro nor TextExpander snippets execute while in the VBA editor.


Tested with Microsoft Excel 16.16.27 from Office 2016.


Hey Anthony,

Microsoft Excel has a private clipboard that does not play nice with the system clipboard.

To make Excel's clipboard sync with the System, you have to switch out of Excel and then back again. It's clunky, but it works.

Here's an example for pasting into the Excel VBA Editor:

Microsoft Excel ⇢ Insert String into Visual Basic Editor v1.00.kmmacros
Keyboard Maestro Export

You can use a similar technique to copy from it.

You can use Keyboard Maestro native actions for switching instead of the shell:

ACTIONS ARE DIRECTLY IMPORTED INTO THE MACRO BEING EDITIED!
Keyboard Maestro Actions.kmactions (1.3 KB)

Typinator works in the VBA editor just fine, although it beeps at you when inserting a string.

-Chris

Thanks Chris. I've modified your macro successfully to copy the VBA text. I discovered this issue actually trying to use your macro of appending to the system clipboard where the copy text to Clibpboard_B was failing.

I've not used Typinator and can't compare it to TextExpander. I'll reach out to TextExpander support for their perspective.

1 Like