how to open *csv in Calc Macro with tabulation (file is export from SAP in uncorrect format *xls - really it's *csv) -
Code: Select all
Sub testCSV
Dim oDoc1, oDoc2 as Object
Dim oFile1, oFile2 as String
Dim oRange1 , oRange2 as Object
Dim oURL1, oURL2 as String
Dim oCell as Object
Dim oSheet as Object
Dim i,r,b,c,d,y,x as Integer
dim aProps(1) As new com.sun.star.beans.PropertyValue
oFile1 = "file:///media/user/Data/Folder/FILE.XLS"
oURL1 = convertToUrl (oFile1)
aProps(0).name = "FilterName"
aProps(0).Value = "Text - txt - csv (StarCalc)"
aProps(1).name = "FilterData"
aProps(1).Value = "<TAB>,,76,1"
oDoc1 = starDeskTop.loadComponentFromURL (oURL1, "_blank", 0, aProps() )
End Sub