AHK Clipboard & Excel returns "The picture is too large and will be truncated" Topic is solved

Get help with using AutoHotkey and its commands and hotkeys

AHK Clipboard & Excel returns "The picture is too large and will be truncated"

07 Dec 2016, 10:20

Following situation:
- starting the below .ahk
- start MS Excel
- COPY from Excel a complete column (e.g.: column A:A) or at least 62 cells of a column

With this situation I get this error from Excel:
“The picture is too large and will be truncated”

Without running .ahk script it works without error.

I tried to increase memory with #MaxMem and VarSetCapacity but without success. Also added the ClipWait line in the code without success.

Does anyone have a hint?

Code: Select all



   ClipSaved =   
   ClipSaved := ClipboardAll    
Posts: 1756
Joined: 29 Sep 2013, 17:11

Re: AHK Clipboard & Excel returns "The picture is too large and will be truncated"  Topic is solved

07 Dec 2016, 15:10

It's Excel, not AHK, that is displaying the error. #MaxMem and VarSetCapacity are not applicable.

ClipWait waits for the clipboard to contain any data. It already contains data. If you want to use clipwait, you need to clear the clipboard first (but then you are changing the clipboard contents, which would trigger OnClipboardChange, so you need to account for that). Correction:
OnClipboardChange wrote:If the clipboard changes while an OnClipboardChange label or function is already running, that notification event is lost. If this is undesirable, specify Critical as the label's first line. However, this will also buffer/defer other threads (such as the press of a hotkey) that occur while the OnClipboardChange thread is running.

This post seems to suggest that Excel does not like it when other programs touch the clipboard:
https://answers.microsoft.com/en-us/mso ... 6f1f559438

This post suggests that increasing virtual memory may help (I'm skeptical). It also suggests removing Clip Organizer.
https://social.technet.microsoft.com/Fo ... orum=excel

Is there more to your script? Is that just an example? I don't see how that script could be useful because the ClipSaved variable is cleared as soon as the function returns.

Maybe your function could check if Excel is active and ignore those ones?

Edit: Corrected some of the OnClipboardChange comments above.
Last edited by kon on 08 Dec 2016, 17:47, edited 1 time in total.
Posts: 70
Joined: 04 Aug 2016, 04:27

Re: AHK Clipboard & Excel returns "The picture is too large and will be truncated"

08 Dec 2016, 01:04

OFC this script itsself would make no sense. The script is only a "cleared" example, which is reduced to/showing the core problem. I have this problem with Win7 + Excel 2010 and 2013 (no other Excel/OS tested).
Also I though of an check if Excel is activce, but the reason for use that script is to save the clipboarddata because a "special" other program does overwrite clipboard with it's own data. So this would be the last option for me.

Return to “Ask For Help”

Who is online

Users browsing this forum: boiler, Karrsen, kczx3, Kolo, mikeyww, Paiter, solidsnake_fear and 36 guests