Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

May 18th 10AM ET, Live Chat, bring your QlikView questions. REGISTER
Showing results for 
Search instead for 
Did you mean: 
Contributor III
Contributor III

Export Graphic Chart to Excel?

Hi guys, i got a question.

Im trying to do something really simple i guess...

A simple code that its working for me:

sub Printeste

set obj = ActiveDocument.GetSheetObject(Status)

conteudo = Day(Date) & "-" & Month(Date) & "-" & Year(Date)


end sub

since "status" is a function that calls the sheet that is not minimized. With normal charts it is working good. But my problem comes when i have to export Graphic Charts...

ive been searching for a while, here in qlikview community also, that i have to use "ExportBitmapToFile"... but, i have to save it as jpg or bmp, right?

So my question is, there's a way to use ExportBitmapToFile and 'merge' this image to a XLS?

This is my first macro actually, so, my next step(at least i was pretending) is to call 2 charts to a XLS file, a normal chart and a graphic chart. It would be awesome if there's a way to do that.

4 Replies
Luminary Alumni
Luminary Alumni

This process should help you out (not created by me):


or from the Share Qlikviews:


Hope that helps,

Matt - Visual Analytics Ltd

Contributor III
Contributor III

Hi Matt, ive seen this idea before(sorry not to mention it) and i believe that it works for my purpose.

But what i'm trying to do is something automatic... Thats why im using the "status" function, to call the 'active' chart(not minimzed). I know that Qlikview already do that by default, but i want to do the exact same thing with multiple charts. And in this case that you posted, all charts are pre defined.

I was wondering if its possible to do, maybe an 'if' state in my macro... something like

if obj.GetObjectType = "10" or "11"




and then merge those files

Im not a expert in macros, but i believe i can edit some things on that code to get what i want(it will take some time hehe)...

I dont know if i am being clear... but thanks for your answer =D

Contributor III
Contributor III

Ok guys, i've found an example and changed it a little to make it automatic. here it goes:

sub fazerxl

Set Doc = ActiveDocument

Set DocProp = Doc.GetProperties

Directory = DocProp.MyWorkingDirectory


Set AppExcel = CreateObject("Excel.Application")

AppExcel.Visible = False


set s=ActiveDocument.ActiveSheet


for i=lbound(objs) to ubound(objs)

if not(objs(i).IsMinimized) then

select case objs(i).GetObjectType

case 10,11,12,13,14,15,16,20,21,22,27,28,37

set objInt = objs(i)

id = replace(objInt.GetObjectId,"Document\","")

Set plan = Doc.GetSheetObject(id)

ActiveDocument.ClearAll false

ActiveDocument.getApplication.sleep 5000


AppExcel.ActiveSheet.Name = id


select case objs(i).GetObjectType

case 10,11

plan.CopyTableToClipboard True

case 12,13,14,15,16,20,21,22,27,28,37


end select



ActiveDocument.getApplication.sleep 5000

end select

end if


salvar = Directory & "\testes" & Day(Now) & "-" & Month(Now) & "-" & Year(Now) & "-" & Hour(Now) & ".XLS"

AppExcel.ActiveSheet.SaveAs (salvar)


end sub

So, the idea is... get all charts not minimized, and put every each one in a particular sheet in the Excel.

It was working good so far doing my tests... but, sometimes i got an error on "AppExcel.ActiveSheet.Paste"

Im trying here doing some tests why in some charts i got this error... but if anyone got an idea about it... let me know, ok =D

Not applicable

Hi All,

Just a quick question in the reverse direction. Is it possible to export a chart from EXCEL to QLIKVIEW?

I suppose this is not a place ask this question yet awaiting answers for the same.