Issue with Assigning Clipboard Value to Variable After Hotkey CTRL + C

Answered
0
0

Hi,

I’m encountering an issue where I’m unable to assign a clipboard value to a variable after executing a Hotkey step with CTRL + C. I’ve tried various approaches, including adding pauses, repeating the CTRL + C command multiple times, and even using a Script Step, but none of these worked.

Below is the error I’m receiving:

Error ocurred in step [“CopyClipboardToVariableStep”, “creditCardType”,”4bd1def1-8849-7bdd-bab3-e75f74b62283″]. Error: System.Runtime.InteropServices.COMException (0x800401D0): OpenClipboard Failed (0x800401D0 (CLIPBRD_E_CANT_OPEN)) at System.Runtime.InteropServices.ComTypes.IDataObject.GetData(FORMATETC& format, STGMEDIUM& medium) at System.Windows.DataObject.OleConverter.GetDataFromOleHGLOBAL(String format, DVASPECT aspect, Int32 index) at System.Windows.DataObject.OleConverter.GetDataFromBoundOleDataObject(String format, DVASPECT aspect, Int32 index) at System.Windows.DataObject.OleConverter.GetData(String format, Boolean autoConvert, DVASPECT aspect, Int32 index) at System.Windows.DataObject.OleConverter.GetData(String format, Boolean autoConvert) at System.Windows.Clipboard.GetText(TextDataFormat format) at Robotiq.ScriptExecutor.StepHandlers.Implementation.CopyClipboardToVariableStepHandler.HandleCore(Boolean startRobotLocaly) at Robotiq.Steps.Common.StepHandler.Handle(Boolean startRobotLocally).
Source: CopyClipboardToVariableStepHandler
  • You must to post comments
Best Answer
0
0

Hi,

I had the same issue, but I managed to resolve it using a Python Step. Below is the Python code that successfully performs the task, hope it helps!

import pyautogui
import time

# Optional: Wait a bit before performing the action
time.sleep(2)

# Press CTRL+C to copy
pyautogui.hotkey(‘ctrl’, ‘c’)

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.