Can't copy from Excel

I’m having trouble copying from Excel at all.

If I copy from Excel as normal and paste in another app manually (not with KM), all works as expected. But if I ask KM to copy and then write the copied text to a file, it can’t do it. Instead, the text it writes to a file is an old clipboard—as if the copy failed.

I suspect this is because of a bug in KM 7.0. This should be fixed in 7.0.1 according to Peter

Sounds like clipboard caching to me. See:

Alternatively it may require a pause after the Command-C for Excel to get around to completing the copy.

No, that only affects the Copy/Cut/Copy to Named Clipboard actions, not Command-C as is used in @Jack_Brannen’s macro.

But it could be similar in that it is simply the Command-C not being processed fast enough.

I’m not sure this is related, but just in case . . .

I remember reading a post recently that Excel may not put everything on the clipboard (in response to a COPY) until the user switches to another app.

Thanks, guys.

Guess what, it wasn’t a copying problem at all. It was a pasting problem.

I tried copying to a NAMED clipboard and then inspecting that clipboard in KM. It retained a bunch of formatting from Excel that apparently can’t be written into a TSV, at least not directly using the KM engine.

If I directly paste this formatted clipboard content into another app manually (as I did earlier when I was troubleshooting), the system strips the formatting on its own and just dumps the text. So it looks right. But KM doesn’t do that automatically, which is why it fails when trying to write to a TSV.

Inserting a “Filter Clipboard - Remove Styles” action solved the problem.

Peter, FWIW, it would be great if this could have triggered the new “Notify on Failure” feature.

1 Like

After further testing:

I mentioned in my first post that sometimes the macro “worked” but with past clipboards. This was because the CUT actually happened slower than the WRITE TO FILE. So it wrote “one clipboard ago,” so to speak.

The doc Peter linked to above addresses this problem.

A short pause fixed it.