Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor

CopyBitmapToClipboard

Hi!

I have a problem when I try to copy an object into a Word (as Image) mutiple times.

This is a sample of the script that I've done:

Sub Report


Set XWord = CreateObject("Word.Application")
XWord.Visible=true

Set DocWord = XWord.Documents.add()

Set F= ActiveDocument.Fields("User")
Set FieldValue= F.GetSelectedValues(F.GetValueCount(1))

For k=0 to F.Count-1


ActiveDocument.Fields("User").Select FieldValue.Item(k).Text

XWord.Selection.InsertBefore "Titulo"&chr(13)
XWord.Selection.Collapse wdCollapseEnd

ActiveDocument.ClearCache
ActiveDocument.GetApplication.WaitForIdle

set image = ActiveDocument.GetSheetObject("CH684")
image.CopyBitmapToClipboard
XWord.Selection.Paste

next

end sub

The Script stops when it reaches "image.CopyBitmapToClipboard".Does somebody know if there is a issue with this function?

Version: 9.00.7320.7 SR2 64-bit Edition

Thanks!

Tags (1)
5 Replies
Highlighted
Partner
Partner

AW:CopyBitmapToClipboard

Hi, Sylverine,

try the command ExportBitmapToFile, look for further information in the APIGuide.QVW, situated in you QlikView program folder and Documentation

Highlighted
Contributor
Contributor

AW:CopyBitmapToClipboard

Hi Martina,

Thanks, but I need the charts in a .Doc and not in a File, because what I'm doing is a report and I Mix them with other objects and Text.

Regards,

Syl

Highlighted
Partner
Partner

CopyBitmapToClipboard

Hi, I tried your code and I got an error even before you got it.

I created a sample app with two different macros based in your code.

With a little adjustment in it I was able to export, but only when there was a selection in the field.

I created a second macro where you can export all posible values (user can make selection on otherf fields, and we don't export anything if it is not related).

Please, don't mind the charts, they don't make any sense. I was just using this to study the macro.

Hope it works for you.

Highlighted
Not applicable

CopyBitmapToClipboard

QV 9 is really different from QV 8, your code will function well in QV 8.

Please add a line code as following:

ActiveDocument.GetApplication.WaitForIdle

set image = ActiveDocument.GetSheetObject("CH02")
image.CopyBitmapToClipboard
XWord.Selection.Paste

I met this issue before and got offical reply as above.

May it will help you.

Highlighted
Contributor
Contributor

Re: CopyBitmapToClipboard

Has anyone come up with a solution for this in QlikView 11.2? I have tried ActiveDocument.ClearCache, ActiveDocument.GetApplication.WaitForIdle 50 (and other parameters), but the macro I am working with still stops at CopyBitmapToClipboard when trying to loop through multiple objects and export them to Excel.