Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Showing results for 
Search instead for 
Did you mean: 
Not applicable

A way to Check If the "Copy To Clipboard" Function Failed


Is there a way to check if the function Copy to Clipboard failed?

I am exporting multiple objects, but it is possible for the objects to not contain any results, which means the copy to clipboard function fails and the export ends. Ideally I want to put in an IF..THEN..ELSE statement checking whether the copy to clipboard is successful before it actually has to copy the object so that it can complete the export.

Is anyone aware of a way to do this?


if currObj.CopyTableToClipboard = nothing then



ActiveSht.Cells(EmptyRow,1) = currObj.GetCaption.Name.v
ActiveSht.Cells(EmptyRow +1,1) = "No Results"
end if


1 Reply
MVP & Luminary
MVP & Luminary

Regarding to the description from CopyTableToClipboard statement within the APIGuide.qvw it returned a true or false if it was successful or not. But I believe this won't be really helpful then it is only for this moment valid when the statement is executed. Already by the next script-row this is in the past and the content from clipboard could be changed through your own actions or from any other software/services which currently run. Such scripts should be run as far as possible alone maybe within an overnight-task.

Therefore it could be better to check if the paste statement is successful (read one of the target-cells) and if it failed or it occured an error by inserting the object you called your sub recursiv or some parts of them (you will need a counter for this and/or to split your routine in various sub/functions) .

- Marcus