Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Contributor III

Sometimes. Macro paste method failed or incorrect format. Clipboard?

Hi, all!

It has long been observed that sometimes the most common simple VB macros to work through the clipboard in different locations, or an error or rarely inserts incorrect data (for example, instead of the text that is ????? question marks).

Again, that makes me angry sometimes works, sometimes not. That is the reason I can not understand yet.

As I understand it, I is not one, there is at least an understanding of the causes? Or are other ways to work complex algorithms and complex formats in excel but not through the clipboard?

1 Solution

Accepted Solutions
Highlighted
MVP & Luminary
MVP & Luminary

Re: Sometimes. Macro paste method failed or incorrect format. Clipboard?

The reasons for errors by copy + paste per clipboard are rather rarely but if they occur they are very difficult to identify and to resolve. I think that in the most cases the OS will cause the errors because the clipboard.exe belonged to them and qlikview used this feature like any other programs does.

Take a look here to understand the problem more clearly and which things could be tried to resolve the problem:

Re: Failed to copy to clipboard

Re: copy clipboard failed

The following approach will completely avoid the copy-topic because the qlik-objects will be read cell for cell and could be write in the same way in excel:

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

- Marcus

View solution in original post

3 Replies
Highlighted
MVP & Luminary
MVP & Luminary

Re: Sometimes. Macro paste method failed or incorrect format. Clipboard?

The reasons for errors by copy + paste per clipboard are rather rarely but if they occur they are very difficult to identify and to resolve. I think that in the most cases the OS will cause the errors because the clipboard.exe belonged to them and qlikview used this feature like any other programs does.

Take a look here to understand the problem more clearly and which things could be tried to resolve the problem:

Re: Failed to copy to clipboard

Re: copy clipboard failed

The following approach will completely avoid the copy-topic because the qlik-objects will be read cell for cell and could be write in the same way in excel:

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

- Marcus

View solution in original post

Highlighted
Contributor III

Re: Sometimes. Macro paste method failed or incorrect format. Clipboard?

Thank you we will think

Highlighted
Contributor III

Re: Sometimes. Macro paste method failed or incorrect format. Clipboard?

In this topic Re: copy clipboard failed Thank you, these days have shown that you are absolutely right

I have noticed that following statements are missing which often avoid problems:

qvDoc.GetApplication.WaitForIdle 'wait until all qv calculations are finsih

XLDoc.sheets(YourSheet).Activate 'activate the sheet before using