Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
matthewp
Creator III
Creator III

Export whole sheet as image to Word

I want to export my sheet to word.

I have tried the macro

sub ExportWord

set objWord = CreateObject("Word.Application")

objWord.visible = true

set objDoc=objWord.Documents.add

Const wdOrientLandscape = 1

objDoc.PageSetup.Orientation = wdOrientLandscape

ActiveDocument.GetSheetObject("SH01").CopyTableToClipboard true

objWord.Selection.Paste

end sub

but it just opens up the macro screen and a word document and doesn't paste

1 Solution

Accepted Solutions
marcus_sommer

As far as you want to export more than one object or various selection-states from one object you will need a loop through your objects/selections and also a logic to paste them anywhere and position and size them.

For this you will need some efforts to get it work like you want - whereby with the example above and maybe this one: EXPORTING QLIKVIEW OBJECTS TO MICROSOFT WORD TO PREDETERMINED LOCATION.docx it isn't too difficult to adapt the logic (at the beginning start small with a loop over two/three objects/selections and commenting out the various options and then increase step by step the loop-numbers and the complexity).

- Marcus

View solution in original post

5 Replies
marcus_sommer

You couldn't address a sheet over a sheetobject you need a different statement like:

ActiveDocument.ActiveSheet.CopyBitmapToClipboard

- Marcus

matthewp
Creator III
Creator III
Author

Excellent!

Can you change the quality of the export?

Also would there be a way to export all charts as individual images but into the same word doc?

marcus_sommer

If you mean with quality of the export a slight degree within the sharpness then AFAIK it couldn't be improved. If you creates reports with the report-editor you will get sharp reports but also some other problems. Maybe tools like NPrinting are more suitable.

Beside them if you want to loop over all sheets then take a look here: Automated PowerPoint Presentation Extraction. It's for powerpoint but the logic could be adapted to word.

- Marcus

matthewp
Creator III
Creator III
Author

Ok so that is a bit too much for me to take on.

what about just exporting just 1 chart to word something like...

sub ExportWord

set objWord = CreateObject("Word.Application")

objWord.visible = true

set objDoc=objWord.Documents.add

Const wdOrientLandscape = 1

objDoc.PageSetup.Orientation = wdOrientLandscape

ActiveDocument.GetSheetObject("CH01").CopyTableToClipboard true

objWord.Selection.Paste

end sub

marcus_sommer

As far as you want to export more than one object or various selection-states from one object you will need a loop through your objects/selections and also a logic to paste them anywhere and position and size them.

For this you will need some efforts to get it work like you want - whereby with the example above and maybe this one: EXPORTING QLIKVIEW OBJECTS TO MICROSOFT WORD TO PREDETERMINED LOCATION.docx it isn't too difficult to adapt the logic (at the beginning start small with a loop over two/three objects/selections and commenting out the various options and then increase step by step the loop-numbers and the complexity).

- Marcus