Why could this script fail:
XLApp.Sheets(1).PasteSpecial Format = Bitmap
The error that is given:
Wrong number of arguments or invalid property assignment: 'ActiveDocument.GetSheetObject(...).CopyBitmapToClipboard'
When I change from CopyBitmapToClipboard to CopyTableToClipboard macros executes just fine, only I do get the table not a chart.
Could anybody please help me out?
Solved! Go to Solution.
I do not have any comments on that. I did change it to Paste
Unfortunately I guess that's not the case because while running the code it highlights this line:
AFAIK copybitmaptoclipboard hadn't a further parameter TRUE/FALSE because it's only a switch by table-charts and copytabletoclipboard. Beside them you need to ensure that "eur" is really a valid object-id and that this object is currently displayed within qlik - if it's hidden in a container or by a condition or minimized it won't work.
The chart is not hidden or minimized, the object ID is valid:
I am also using copytabletoclipboard as well as copybitmaptoclipboard thats why I am using the parameter TRUE/FALSE. By removing it nothing changes the script stops on the same line but without showing any error.
If a qlik macro failed the cursor-position within the macro-editor isn't mandatory by the error and might therefore leading in wrong direction. Put a few msgbox in your code to find the real place where the error happens. If this didn't help please provide an example.
|MsgBox "This is fun"|
|'MsgBox "This is fun2"|
|XLApp.Sheets(1).PasteSpecial Format = Bitmap|
With the MsgBox "This is fun" everything works fine. But when I comment it everything stops again. How to understand this? What am I missing?
That's strange - maybe something is still processing and not yet finished if you call your routine respectively between the various statements within the routine. To resolve this you could use the following statements:
rem ** let QV sleep for 1 seconds **
Beside them I think I wouldn't rather use a selection-statement to the sheet:
else just activating the sheet, select a certain range and than paste your content maybe in this way: