This Techinline Blog post pretends that this error occurs when a third party app (my AHK script in this case) retrieves the content of the Clipboard for CF_METAFILEPICT format.
My app is not reading specifically the CF_METAFILEPICT. It reads the system variables Clipboard and ClipboardAll. It also retrieves some specific formats (like HTML or RTF) using the WinClip library. But it never gets the CF_METAFILEPICT format.If your application interacts with the Windows clipboard using OLE technology, this indicates that somewhere your source code calls of the IDataObject interface. This interface contains the GetData method, which can result in the described Excel error when it tries to receive clipboard content in CF_METAFILEPICT format.
How to fix:
Skip the GetData call if the requested format is CF_METAFILEPICT.
It would be great if @lexikos or another AHK insiders could take a look at it. Does the AHK runtime retrieve the CF_METAFILEPICT format when building ClipboardAll?
TIA