I want to programmatically (Libre Office Basic) export a sheet to csv, while having all cells wrapped in quotes, also numbers.
According to Open Office’s Documentation on Filter Options the 8th parameter will achieve that:
If false, the numbers are stored as text, with text delimiters.
Right now I tried the following:
Dim FilterOptions(1 to 9) as String
FilterOptions(1) = Asc(",") ' Field Separator
FilterOptions(2) = Asc("""") ' Text Delimiter
FilterOptions(3) = "0" ' Character Set
FilterOptions(4) = "1" ' Number of First Line
FilterOptions(5) = "1" ' Cell Format
FilterOptions(6) = "" ' Language
FilterOptions(7) = "true" ' Quote all texts
FilterOptions(8) = "false" ' Store numbers as such (or text)
FilterOptions(9) = "true" ' Save cell contents as shown
document.StoreToURL(FileURL, Join(FilterOptions(), ","))
This doesn’t seem to work. Somehow the 8th option controls whether the numbers are stored as number or as shown.
I also have the feeling that these Filter Options should actually influence each other: Save cell contents as shown should contradict Store numbers as such.
Is there any documentation on the actual behaviour of these filters? I tried to find the corresponding code on Github, but so far I wasn’t lucky.