Hallo,
wie kann ich eine CSV Datei per Makro öffnen (Trennzeichen ist und in ein Calc-Document einfügen.
Hatte bisher eine funktionierende Version, doch ab OpenOffice2 geht diese nicht mehr.
Wenn also jemand weiss wie ich das auch unter OPen Office2 hinkriege, bitte melden.
Vielen Dank
Bernd
Hier also der Code Ich hoffe jemand kann helfen, Dankeschön
Function OpenCSVFile (sUrl As String) As Object
Dim fileProperties(2) As New com.sun.star.beans.PropertyValue
fileProperties(0).Name = "FilterName"
fileProperties(0).Value = "scalc: Text - txt - csv (StarOfficeCalc)"
fileProperties(1).Name = "FilterFlags"
fileProperties(1).Value = "59/9,34,IBMPC_850,1,1/1/1/1/1/1/1/1"
'59/9 --> columns are devided by ";" and tab
'34 --> text delimiter --> double qoutes (")
' IBMPC_850 --> charset (is a constant with the value 4)
' 0 is system charset
fileProperties(2).Name = "Hidden"
fileProperties(2).Value = True
OpenCSVFile = StarDesktop.loadComponentFromURL(sUrl, "_blank", 0,fileProperties())
End Function