← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #247422]: How To Resolve "cannot open system clipboard" error

 

Question #247422 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/247422

Andrew Grabov posted a new comment:
Hi,

I have almost the same case:  I extensively use the following code while processing Excel:
    type(Key.INSERT, Key.CTRL)
    cellValue = Env.getClipboard().strip()

And at some point (randomly, sometimes after 5 rows, sometimes after 20 rows) I am getting the error:
    Env.getClipboard: clipboard not available: cannot open system clipboard

I have even added such hook in order to repeat the access to clipboard:
    if (cellValue == "") :
        print ("HOOK 1: empty")
        type(Key.ESC)
        type(Key.INSERT, Key.CTRL)
        cellValue = Env.getClipboard().strip()

Probably it helps but at some point on second attempt to access
clipboard it stops working as well.

In case there is no possibility to access Excel file programmatically,
is it possible to somehow solve the error, maybe by implementing some
workaround?


I have searched extensively this forum and internet for this error, but beside the following topic didn't find anything helpful:
    "Using the native getClipboard method in eclipse"
    https://answers.launchpad.net/sikuli/+question/170984


Environment:
IDE: Sikli 1.1.1 (and also tried with 1.1.2)
OS: Windows 7 (64-bit)
Java 8 x64 b131

Thank you in advance!

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.