Bug: Strange Excel behavior because of the KM Clipboard History Switcher?

Hello! A few co-workers of mine discovered some very odd behavior with the desktop version of Excel when copying and cutting content.

If you Copy, it works and appears on the Clipboard, but a random Excel window flashes on screen, which didn't happen before. Not the biggest deal, just strange.

But if you Cut, the content goes away, a random Excel window flashes, and then you can't undo in Excel, so the content is just gone as it is not on the Clipboard History Switcher. And this is very destructive.

Excel_KM_CopyCuyBug

After some research, we discovered that if we exclude Excel from the Clipboard History Switcher in the KM Settings, this behavior no longer occurs!

Anyone else experience this behavior and no why this would have started happening all of the sudden? It doesn't make much sense to me and I can't figure out if the bug is in KM or Excel?

Any insight would be appreciated, thank you!

I had something similar happen a long time ago, and being able to exclude the app from KM's Clipboard History was the solution there too.

My guess is that Excel is doing something non-standard, and that's the source of the problem, but it's just a guess. In any case, I doubt another solution will come around.

(See, I'm using reverse logic here - whenever I say something like that, someone almost always comes around and proves me wrong. So maybe you'll get a solution now. :slight_smile: )

1 Like

Thank you @DanThomas! This is good to know, although unfortunate on Excel's part :joy:

I just wonder what exactly is happening and why this just started happening last week. We've been using KM and Excel for a while and didn't see this behavior before, it's very odd!

Either way, thanks for the response, and holding out hope that your reverse logic works! :wink:

That is definitely strange. Here's some questions you might ask yourself:

  1. Has either Excel or KM been upgraded just before the problem came up?
  2. Have you written or changed any KM macros that might mess with the clipboard somehow?

Other than that, "you're on your own". :stuck_out_tongue:

Microsoft apps have a long history of placing flavors of data on the public clipboard that they don't actually want anyone to read, and that cause problems if they are read.

There is a feature in Keyboard Maestro to resolve this by excluding certain clipboard flavors from being read - Keyboard Maestro already does this for known problematic flavors, but sometimes Mcirosoft find new ways.

To find the flavor causing the problem, reenable clipboard history in Excel, and then in Keyboard Maestro’s status menu, hold the option and shift key down and select Start Debugging, that will enable a clipboard debugging mode.

A debugging window will appear.

Then copy something in the problem application.

All the flavors that were copied will be listed, with all the normal ones unchecked and all the non-standard ones checked. The checked ones are now ignored. So now try again, and Copy should work safely in the target application.

Turn off each non-standard checkbox in turn, check whether Copy works. If it causes problems, turn it back on, if it does not, leave it off.

Let me know the minimum flavors that need to be left checked to avoid the problem.

You should also report this to Microsoft, as their code should not cause problems when the public clipboard flavors are read.

6 Likes

Thank you @DanThomas and @peternlewis! What a great debugging feature! The new things I learn in KM are always mind-blowing!

Following your steps, I was able to find the culprit:
image

Thanks again for the replies and helping me figure out this mystery. I will also report this to Microsoft.

2 Likes

"ShadowWorkbook". That's not suspicious sounding or anything... :joy:

2 Likes

In the Terminal, now do:

defaults read com.stairways.keyboardmaestro.engine ExtraIgnoredClipboardFlavors

That should give an error presuming you have not configured it, which is good. If it gives an error, then do:

defaults write com.stairways.keyboardmaestro.engine ExtraIgnoredClipboardFlavors "com.microsoft.ShadowWorkbook"

Then restart the Keyboard Maestro Engine and it should ignore that flavor in the clipboard history.

2 Likes

Yep, that worked, amazing! Thanks @peternlewis!

@DanThomas, yeah, agreed :sweat_smile: That name somewhat matches the behavior since what appeared to be a blank workbook would flash on screen :grimacing:

Appreciate the help all!

3 Likes