Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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

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