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

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Guest1234

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

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

#Persistent 

OnClipboardChange("ClipChanged")

ClipChanged(Type)
{
   ClipSaved =   
   ClipSaved := ClipboardAll    
   ClipWait,5,1
}
kon
Posts: 1756
Joined: 29 Sep 2013, 17:11

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

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.
/Correction

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.
foxhunter
Posts: 72
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.
User avatar
JnLlnd
Posts: 490
Joined: 29 Sep 2013, 21:29
Location: Montreal, Quebec, Canada
Contact:

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

07 Feb 2024, 10:38

This "The Picture Is Too Large and Will Be Truncated" issue has been discussed in the following thread and a solution is proposed:
viewtopic.php?style=19&f=81&t=125745
:thumbup: Author of freeware Quick Access Popup, the powerful Windows folders, apps and documents launcher!
:P Now working on Quick Clipboard Editor
:ugeek: The Automator's Courses on AutoHotkey

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], Spawnova, tabr3 and 225 guests