Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Export to CSV Macro

Hi all,

I have straight table objects with ID's: "HPA", "RBM", "Listing".

I'm trying to write a macro which exports these tables in csv format, into folders I specify.

Object "HPA" and "RBM" are in a Container Object. If table "HPA" is not selected in that container, the first part of the code will not work. Similarly if "RBM" is not selected in the container the Object2 part will not work.

Has anybody got any tips on how to overcome this?

Thanks

Adam

The code I am using is below:

Sub ExportToFile

set sObject1 = ActiveDocument.GetSheetObject("HPA")

sObject1.Export "\\S32020\shared$\Operations\MI\02 Data\Qlikview\Sales\SL_HPA_Summary.csv", ", "

set sObject2 = ActiveDocument.GetSheetObject("RBM")

sObject2.Export "\\S32020\shared$\Operations\MI\02 Data\Qlikview\Sales\SL_RBM_Summary.csv", ", "

set sObject3 = ActiveDocument.GetSheetObject("Listing")

sObject3.Export "\\S32020\shared$\Operations\MI\02 Data\Qlikview\Sales\SL_Listing.csv", ", "

End Sub

1 Solution

Accepted Solutions

Re: Export to CSV Macro

I think you must activate these objects - see here: http://community.qlik.com/message/275538#275538 and/or in APIGuide.qvw for further possibilities.

Another solution could be to put these objects linked or copied in a hidden sheet (only for various export/print/report reasons and so on) and use them.

- Marcus

1 Reply

Re: Export to CSV Macro

I think you must activate these objects - see here: http://community.qlik.com/message/275538#275538 and/or in APIGuide.qvw for further possibilities.

Another solution could be to put these objects linked or copied in a hidden sheet (only for various export/print/report reasons and so on) and use them.

- Marcus

Community Browser