Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Export to CSV using qlikview macro module, trouble with saveAS

Having issue exporting my file to csv using the macro. If i do it on excel it works perfectly, if i copy the code, i get an expected statement error and i am unable to process it, is there any known troubles in this domain ?

Here is what i did via the macro :

- create a worksheet getting the objects of my dashbaord,

- create a second worksheet2 where i create lines for my csv file in a single column and i hardcoded the separator for example i have :

text;text;ContentofMyTableCell1;date;text

text;text;ContentofMyTableCell2;date;text

text;text;ContentofMyTable2Cell1;date;text

text;text;ContentofMyTable2Cell2;date;text

when i want to save i tried the

workbook.saveAs (name)   ====> that works but produce me a xls

workbook.saveAs(name,xlCSV) ====> Error cannot call a sub in parenthesis

workbook saveAs filename:= name, fileFormat:=xlCSV  =====> error expected statement

any ideas ?

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Did you define the constant xlCSV in your code? If not try using the value 6 instead.


talk is cheap, supply exceeds demand
marcus_sommer

CSV as file-format had several limitations - one is it supported only one worksheet and this is probably why your error occured.

- Marcus