Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
tabletuner
Creator III
Creator III

Export multiple charts to excel with a button

Hello everyone,

I've created a report for my customer consisting of multiple charts (pivot and straight tables) that are placed next to each other. They represent together 1 report that my customer demands.

However, my customer would like to export these charts to excel. The export should result in 1 openend excel file that shows all the data from the charts that represent the report. In my opinion it is not possible to export them all together to excel with a single push on a button in standard QLikview. I hope I am wrong...

I think there might be a VB solution to this. Can anyone confirm this? And can anyone send me an example how to accomplish this in VB script?

Regards,

Tjeerd

4 Replies
Not applicable

Maybe you don't need to create a macro, drag and drop your charts into an Excel spreadsheet. Then save your Excel file.

When you reopen your Excel application, it will connect to the original Qvw file and update the chart.

Also, charts remains Wlikview object you can filter.

To make it work, you need the plugin to be installed on the machine.

Not applicable

maybe with this code could obtain it:


'COMMON REPORT IN ALL THE REPORTS EXCEL
sub A_InformeExcel_ParteComun

dim oDQVInformeExcel
dim oDQVUtils
dim bError
dim auxiliar
dim var
dim linea
dim columna
dim avanza

bError = false

Set oDQVInformeExcel = CreateObject("QlikTech.QlikView")
Set oDQVUtils = CreateObject("QlikTech.QlikView")

Set xls = CreateObject("EXCEL.APPLICATION")

ruta = ActiveDocument.GetPathName

pos = InstrRev(ruta,"\")

ruta_bona = left(ruta,pos)

''ASYNCHRONOUS MESSAGE
'if (not oDllUtils.Inicializar(ActiveDocument)) then bError=true

'oDllUtils.MostrarMsgAsincronico "Wait Please...", "Creating Report Excel"
''

TemplateFile = ruta_bona & "Informes\Plantilla\INFO_MENSUAL.xls"

If Not xls Is Nothing Then

Set objWorkbook = xls.Workbooks.open (TemplateFile)

If objWorkbook Is Nothing Then

msgbox "Could not have acceded to the file < "& TemplateFile & " >. Please look if the route exists."

exit sub

else

'msgbox "Opened the report of Excel"

xls.Visible = False

end if

else


msgbox "One could not have acceded to Microsoft EXCEL"

exit sub

end if

'xls.Visible = True
'=================================================================================================

'BODY OF MACRO

'=============================================================================================
ActiveDocument.GetSheetObject("CH345").CopyBitmapToClipboard
xls.Cells(traslado+1,6).Select
xls.ActiveSheet.Paste
xls.Selection.ShapeRange.ScaleWidth 1, 0, 0
xls.Selection.ShapeRange.ScaleHeight 1, 0, 0
'' Close and Save
'OPTION 2 --> Save in a normal directory
salva = ruta_bona & "Informes\INFO"&right(year(now()),2) &"_"&month(now)&"_"&day(now())&".xls"

xls.ActiveWorkbook.SaveAs salva

'We make the excel visible

xls.Visible = True

'Hide ASYNCHRONOUS MESSAGE
'oDllUtils.OcultarMsgActual

if (bError) then Msgbox "A mistake has happened during the generation of the report", vbCritical or vbOKOnly, "Error"
end sub


I have translated all the messages from the Spanish, sorry for my english...

Regards,

Pol

Not applicable

I think this application can solve the "SendToExcel" problems

NPrinting

Some Video tutorials are here

tabletuner
Creator III
Creator III
Author

Thank you everybody for the overwhelming amount of answers that you sent me. However, for my problem in particulair i have found a walkaround in which i don't need multiple objects anymore.

I am sure I can use your answers in the future!