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

Excel export macro exporting same object

Hello All,

I have the below macro to export three different objects from my QlikView document. However, on completion of this macro, the contents in all three different excel files are the same.

Filenames are being created as defined in the macro but the content of all is that of one of the three objects exported.

Any help or advise on why the macro is behaving in this manner and what can be done to resolve this is much appreciated.

sub ExportSalesOrder

'Get variable
set vExportFilePath = ActiveDocument.GetVariable("vExternalExportPath")
set vForDate = ActiveDocument.Variables("vProcessDate")

'Set variable
vDate = vForDate.GetContent.String
vExpPath = vExportFilePath.GetContent.String

'Export Summary
CSVFile1 = vExpPath & "\" & vDate & "_Summary.xls"
set obj1 = ActiveDocument.GetSheetObject("SUMMARY")
obj1.ExportEx CSVFile1, 5

'Export Sales
CSVFile2 = vExpPath & "\" & vDate & "_Sales.xls"
set obj2 = ActiveDocument.GetSheetObject("SALES")
obj2.ExportEx CSVFile2, 5

'Export Orders
CSVFile3 = vExpPath & "\" & vDate & "_Orders.xls"
set obj3 = ActiveDocument.GetSheetObject("ORDERS")
obj3.ExportEx CSVFile3, 5

msgbox("Data exported to Excel files")

End Sub

0 Replies