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: 
warfollowmy_ver
Creator III
Creator 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
marcus_sommer

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
marcus_sommer

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

warfollowmy_ver
Creator III
Creator III
Author

Thank you we will think

warfollowmy_ver
Creator III
Creator III
Author

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