Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Get Clipboard Text as Variable in Script

Hi QlikView Experts!

Newbie here back with question:

I have this script to copy and read the clipboard text to have further process.

in VBScript I wrote:

Sub ProcessClipboard

ActiveDocument.GetSheetObject("TX01").CopyTextToClipboard

Dim x

x = GET_CLIPBOARD_VALUE

End Sub

How can I set X with clipboard value in QV?

Please help. Thank you.

A

Tags (1)
1 Solution

Accepted Solutions
Not applicable

Re: Get Clipboard Text as Variable in Script

Hi Adrian:

I'm not sure how to read the contents from Clipboard using VBS + Qlikview.  However, in case of straight table, you can read the data by rows and columns with the following script (Source:  Qlikview API Guide)

Sub ReadStraightTable

Set Table = ActiveDocument.GetSheetObject( "CH01" )
For RowIter = 0 to table.GetRowCount-1
   For ColIter = 0 to table.GetColumnCount-1
        set cell = table.GetCell(RowIter,ColIter)
        Msgbox(cell.Text)
    Next
Next

End Sub

There should be a better/easy way, may be I'm not familiar at this moment

Thanks,

Narasimha K

5 Replies
Not applicable

Re: Get Clipboard Text as Variable in Script

Use GetText instead of CopyTexttoClipboard, following is the snippet:

Sub ProcessClipboard

Dim x

x = ActiveDocument.GetSheetObject("TX01").GetText
msgbox x

End Sub

Regards,

Narasimha K

Not applicable

Re: Get Clipboard Text as Variable in Script

Hi Narashima!

Thanks that is really helpful.

But what if the source object is a STRAIGHT TABLE with object ID "CH04"

I got this:

Object doesn't support this property or method: 'ActiveDocument.GetSheetObject("CH04").GetText'

Please help.

Thank you.

Not applicable

Re: Get Clipboard Text as Variable in Script

Hi Adrian:

I'm not sure how to read the contents from Clipboard using VBS + Qlikview.  However, in case of straight table, you can read the data by rows and columns with the following script (Source:  Qlikview API Guide)

Sub ReadStraightTable

Set Table = ActiveDocument.GetSheetObject( "CH01" )
For RowIter = 0 to table.GetRowCount-1
   For ColIter = 0 to table.GetColumnCount-1
        set cell = table.GetCell(RowIter,ColIter)
        Msgbox(cell.Text)
    Next
Next

End Sub

There should be a better/easy way, may be I'm not familiar at this moment

Thanks,

Narasimha K

Not applicable

Re: Get Clipboard Text as Variable in Script

Can't thank you enough Narasimha.

Thank you!

Not applicable

Re: Get Clipboard Text as Variable in Script

Hi,

How to get if the sourceobject  is straight table with object ID "CH28". Then Msgbox() wont work right.

Sub ReadStraightTable

Set Table = ActiveDocument.GetSheetObject( "CH28" )
For RowIter = 0 to table.GetRowCount-1
   For ColIter = 0 to table.GetColumnCount-1
        set cell = table.GetCell(RowIter,ColIter)
        Msgbox(cell.Text)
    Next
Next

End Sub

How to get if source object is line chart.

Thanks,

Sahithya

Community Browser