Cannot open clipboard: Access is dennied.

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Cannot open clipboard: Access is dennied.

Post by armsys » Thu Aug 15, 2013 10:55 pm

After repeating occurances, I now confirm a serious bug:
Cannot open clipboard: Access is denied.
Once the above message pops up, Macro Scheduler freezes/hangs.
BTW, I run AceText in background. Not sure if there's a conflict in terms of clipboard handling.
I suspect the Windows clipboard is being locked.
Question:
How to unlock the Windows clipboard?

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Post by Dorian (MJT support) » Fri Aug 16, 2013 12:37 am

EDIT:March 17th 2014. v14.1 now attempts to access the clipboard 10x before reporting an error. For more details, please see my March 17th reply, further down this thread.

hi Armsys,

Well, that's a new one. We'll have to bring that one up with Marcus when he gets back next week.
Last edited by Dorian (MJT support) on Mon Mar 17, 2014 10:23 pm, edited 1 time in total.
Yes, we have a Custom Scripting Service. Message me or go here

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Fri Aug 16, 2013 1:53 am

Parsnipnose3000 wrote:Well, that's a new one. We'll have to bring that one up with Marcus when he gets back next week.
Hi Parsnipnose3000,
Appreicate your lightning fast reply.
I seem to have resolved the issue:

Code: Select all

// Select all text
Label>CTRL_C
Press CTRL
Send>c
Release CTRL
WaitClipboard
GetClipboard>ClpText
Let>i=1
If>ClpText={"ClpText"}
  Add>i,1
  if>i>5
    Exit
  Endif
  Goto>CTRL_C
Endif
Thanks for your help.

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Fri Aug 16, 2013 8:22 am

After reading again and again the reply from Jan Goyvaerts, the renowned RegEx guru:
"If your macro tool crashes when it can't open the clipboard, then you should report that as a bug to its developers. Any tool that rapidly text to the clipboard in rapid succession should handle inability to access the clipboard as a transient error. It should simply wait a fraction of a second and try again. AceText itself does this. You'll never get any errors in AceText even when another application is hammering the clipboard."
I find it relevant to Macro Scheduler. Perhaps, Marcus should look into it. Macro Scheduler should allow some time, say, 50ms, for the lock to be released.
The bug is definitely serious in a sense that the whole Macro Scheduler freezes. The only way to defreeze it is to kill Macro Scheduler thru Windows' task manager.
By "freezing", I mean the GEAR icon kept blinking but not responding.

User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Mon Aug 19, 2013 7:08 am

I can also confirm a similar issue with this, it related to me copying data from excel to clipboard entries. I changed the way my script ran to resolve the issue, but yes similar issues.
FIREFIGHTER

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Aug 20, 2013 9:25 am

ArmSys .. What was your original macro doing? I can't test and replicate without your code/steps.

If you're sending ctrl-c in a loop without waits then this has nothing to do with Macro Scheduler because ctrl-c is sent blind and Macro Scheduler doesn't even know this has anything to do with the clipboard. The issue would therefore be with the app that receives the ctrl-c.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Tue Aug 20, 2013 9:50 am

Thanks for reply.
Marcus Tettmar wrote:What was your original macro doing? I can't test and replicate without your code/steps.
Simply, prior the code, it setfocus to, say, Word, and attempt to copy a bunch of text to the Windows clipboard.
SetFocus>- Word*
Marcus Tettmar wrote:If you're sending ctrl-c in a loop without waits then this has nothing to do with Macro Scheduler because ctrl-c is sent blind and Macro Scheduler doesn't even know this has anything to do with the clipboard. The issue would therefore be with the app that receives the ctrl-c.
Lately I resolve the clipboard issue by adding Wait>.2 after
Press Ctrl
Send>c
Release Ctrl.

Because the fatal error is issued by and related to Macro Scheduler, I presume Macro Scheduler should at lease ensure the Windows clipboard is ready for GET/PUT operations instead of freezing the Macro Scheduler.

Again, as far as my MS clipboard issue is concerned, it's resolved.
Thanks again.

PaulSR
Pro Scripter
Posts: 65
Joined: Mon Aug 05, 2013 2:58 pm
Location: Edinburgh/Peterborough

Post by PaulSR » Thu Aug 29, 2013 2:31 pm

I too have recently stumbled into this error and resolved it by adding a Wait (0.2 or above) before the "GetClipBoard" instruction.

User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Thu Aug 29, 2013 11:17 pm

Hi Marcus,

Instead of the error it throws up, can this be captured via MS similar to other errors so we can check and resend the command or can MS detect this error and continue to put clipboard until successful.
FIREFIGHTER

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Fri Aug 30, 2013 1:15 am

CyberCitizen wrote:Hi Marcus,
Instead of the error it throws up, can this be captured via MS similar to other errors so we can check and resend the command or can MS detect this error and continue to put clipboard until successful.
I agree to your view totally. But watch out Marcus' fury. Marcus had already pointed his finger to Microsoft, didn't he? Nonetheless, I still believe the annoying clipboard command error can be and should be mitigated by gracefully waiting for the UNLOCK of of the Windows clipboard. At most 5ms will suffice.
Thanks CyberCitizen.

User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Fri Aug 30, 2013 1:32 am

Correct, what he mentioned was a Microsoft issue with the clipboard, but how MS handles that error could be changed or made more user friendly.
FIREFIGHTER

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Aug 30, 2013 7:28 am

CyberCitizen wrote:Hi Marcus,

Instead of the error it throws up, can this be captured via MS similar to other errors so we can check and resend the command or can MS detect this error and continue to put clipboard until successful.
Hopefully, yes.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

rodwaymore
Newbie
Posts: 3
Joined: Thu Nov 08, 2007 4:51 am

Post by rodwaymore » Fri Feb 21, 2014 2:04 am

Is there any other information on this topic? I am having the same problem where I get the "Cannot open clipboard: Access is denied" error from Macro Scheduler.

I have added WaitClipBoard commands, I have added Wait commands, and the problem only happens for the sequence of MacroScheduler commands below(as you can see, I'm just adding WaitClipBoard commands everywhere):

WaitClipBoard
Wait>0.5
Press CTRL
Send>c
Release CTRL
WaitClipBoard
Wait>0.5
GetClipBoard>JobNumberRepeat

I am copying from a field within a web browser. It doesn't happen however if you are copying from Excel to the clipboard. In the same script, I have quite a few of the following command:

XLGetCell>xlBook,Load,CurrentRow,27,LicenseUpgradeSKU
PutClipBoard>LicenseUpgradeSKU

I don't run into any problems with the above command. I only have 2 Ctrl-C copy commands and one or other will randomly produce the error.

The commands are not part of any loop. All the script is supposed to do is get data from Excel and paste the information into various fields in Siebel and then copy the Siebel generated information from 2 fields.

Any information would be greatly appreciated.

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Post by Dorian (MJT support) » Fri Feb 28, 2014 12:02 am

I am not able to give you any more information than this, but, yes. Changes have been made to allow for this, and if everything tests okay, we'll be able to announce more details closer to un upcoming release.

Forgive me for being so vague, as I don't know how much information Marcus is happy with me releasing.
Yes, we have a Custom Scripting Service. Message me or go here

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Post by Dorian (MJT support) » Mon Mar 17, 2014 10:19 pm

Further to my mysterious post on February 28th, 2014, I can now reveal what I was referring to.

v14.1 was released today. If you look at the Version History page you'll notice this :

GetClipboard/PutClipboard will now retry 10x automatically if clipboard locked before giving up & setting error
Yes, we have a Custom Scripting Service. Message me or go here

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts