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: 
Not applicable

macro export of bar chart as a bar chart

I have been trying now for hours and just can't get it right!

I am trying to export a bar chart as a bar chart in a macro to excel, however it just pastes it as a table. Is there any way that I can paste as a picture or bar chart into excel.

The macro script i am using is :

Set chartToExport = ActiveDocument.GetSheetObject("CH2231")
     Set chartProperties = chartToExport.GetProperties
     chartToExport.CopyTableToClipboard true
curSheet.Paste curSheet.Range("A50")
6 Replies
alexandros17
Partner - Champion III
Partner - Champion III

If you need only the image of your barchart you can simply use properties of your chart, go in the tab caption anc check the checkbox copy image to clipboard

Not applicable
Author

I need to automate 15 charts to run into an excel file to be emailed out, I can't run this manually everyday.

That's what my big problem is. And on access point it will not export as a bar graph on export either ....

Siva_Sankar
Master II
Master II

Mandy,

No sure if the following code will work. check it.

Sub ExportGraph()
Dim vSheet
Set XLApp = CreateObject("Excel.Application")
XLApp.Visible = TRUE
Set XLDoc = XLApp.Workbooks.Add
vSheet = ""
vSheet = "Sheet1"
ActiveDocument.GetSheetObject("CH26").CopyBitmapToClipboard 'Copy the charts
XLDoc.Sheets(vSheet).Range("A" & 1).Select
XLDoc.Sheets(vSheet).Paste

Set XLDoc = Nothing
Set XLApp = Nothing

Regards.

Siva

Not applicable
Author

Sadly that does not work either

veidlburkhard
Creator III
Creator III

Hi Mandy,

I found this link from 2011 in this community. May be this can give you some help.

How to Export Qlikview sheets as an image to Excel?

Regards

Burkhard

Not applicable
Author

Nope as soon as I copyBitmap it fails