Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro export to Excel

Hi!

I created a macro for exporting some tables to excel. However if I do it manually (copy an image and special paste (as bitmap) in excel) the picture is much clearer than if I export it via macro. Is it possible to export image to excel and paste it there as bitmap?

Thank you,

M

7 Replies
Not applicable
Author

Hi,

u can try this one, I think this what u expecting

sub test

set XLApp = CreateObject("Excel.Application") ' Define Object

XLApp.Visible = True 'Visible set as true

set XLDoc = XLApp.Workbooks.Add 'Open new workbook

set XLSheet = XLDoc.Worksheets(1) 'Select sheet where data should be pasted

ActiveDocument.ActiveSheet.CopyBitmapToClipboard

XLSheet.Paste XLSheet.Range("A1") 'Paste data into cell

end sub



Thanks & Regards

amars
Specialist
Specialist

Hi,

You can get lot of post's for export to excel or Image. Check this post

http://community.qlik.com/forums/t/41682.aspx

Thanks.

Not applicable
Author

Hi,

this is what I have now. However if I paste image manually - in qlikview select copy as image and then in excel select pastespecial (bitmap), the image is much clearer.

BR,

M

Not applicable
Author

Hi,

Please check the below url, you might get what u want

http://www.qlikblog.at/971/qliktip-32-exporting-multiple-objects-single-excel-document/

Thanks & Regards

Not applicable
Author

Thank you. But the result is the same. After using the macro I get the image on the left. If I use manual solution and copy image and in excel paste as an image I get much clearer image on the right.

Regards,

M

Not applicable
Author

...and attachment for images.

BR,

M

Not applicable
Author

Hi.

I know this is an old post, but there does not seem to be a solution here.. (Or anywhere on the community) So if someone else looks here..

This method works, crystal clear images from Qlikview to Excel.

The resultant Excel file (tested in .xlsx) is smaller in size than standard paste

SUB SendExcel

      set XLApp = CreateObject("Excel.Application") ' Define Object

      XLApp.Visible = True 'False to keep excel not visible

      set XLDoc = XLApp.Workbooks.Add 'Open new workbook

      Set obj = ActiveDocument.GetSheetObject("CH01") 

      obj.CopyBitmapToClipboard()

      XLDoc.Sheets(1).Range("B8").Select

       With XLDoc.Sheets(1) 

          .Range("B8").PasteSpecial _

          Operation=xlPasteSpecialOperationAdd

       End With

End Sub