Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Copy text to clipboard

Hello,

For a certain QV documentI need to create a macro to copy a field value to the clipboard so it can be used in another application. The macro I created works perfect in the local desktop client (8.5) but it refuses to work by using the ActiveX browser plugin.


Sub CopyCNR
set ContractNr = ActiveDocument.fields("Contract_Number").GetSelectedValues
If ContractNr.Count=1 Then
ActiveDocument.GetSheetObject("TX03").CopyTextToClipboard
Else
Msgbox("Select one value.")
End If
End Sub


The macro partly works though the ActiveX plugin and does result in an message when not selecting one single value. But the problem is that no value is copied to the clipboard. Is there a solution for this problem.

Another thing I have noticed is that when pressing the right mouse button on a text object to see the menu. The option/menu "Copy to Clipboard" is grayed out.

regards Mark

1 Solution

Accepted Solutions
Not applicable
Author

I have a similar macro which works with the plugin. Do you "allow export" on the security setting on the document? /Michael

View solution in original post

4 Replies
Anonymous
Not applicable
Author

Mark,
Some QV APIs don't work as expected in this situation. See if you can get the value to the clipboard using VBscript functionality rather than QV API.

Not applicable
Author

Michael,

Thanks for your answer. I'm already using a VBscript macro to copy a textvalue to the clipboard. The problem is it doesn't work through the ActiveX plugin. The fact that the Copy (right mousbutton) meny is grayed out could have something to do with document/user/server settings, the problem is I can't find the solution.. Hope somebody can help me.

regards Mark

Not applicable
Author

I have a similar macro which works with the plugin. Do you "allow export" on the security setting on the document? /Michael
Not applicable
Author

Thanks a97mic,

That solved my problem. You are the best...

regards Mark