ich habe vor ca.15 Jahren ein Makro gebastelt, das Calc-Dateien als CSV-Dateien exportiert. Das funktioniert auch alles immer noch prima.
Jetzt hätte ich gerne, dass beim Exportieren automatisch eine Leerzeile angehängt wird, ohne, dass irgend jemand irgendwie eingreifen muss.
Hier das Makro:
Code: Alles auswählen
sub MachCSV_Fleisch
dim document as object
dim dispatcher as object
dim sUrl1$
Dok = ThisComponent
Controller = Dok.CurrentController
Blatt = Controller.ActiveSheet
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dispatcher.executeDispatch(document, ".uno:Save", "", 0, Array())
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "ToPoint"
args2(0).Value = "$B$7:$J$100"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args2())
dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())
dim args4(0) as new com.sun.star.beans.PropertyValue
args4(0).Name = "Nr"
args4(0).Value = 2
dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args4())
dim args5(0) as new com.sun.star.beans.PropertyValue
args5(0).Name = "ToPoint"
args5(0).Value = "$A$1"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args5())
dim args6(5) as new com.sun.star.beans.PropertyValue
args6(0).Name = "Flags"
args6(0).Value = "SDV"
args6(1).Name = "FormulaCommand"
args6(1).Value = 0
args6(2).Name = "SkipEmptyCells"
args6(2).Value = false
args6(3).Name = "Transpose"
args6(3).Value = false
args6(4).Name = "AsLink"
args6(4).Value = true
args6(5).Name = "MoveMode"
args6(5).Value = 4
dispatcher.executeDispatch(document, ".uno:InsertContents", "", 0, args6())
dim args7(2) as new com.sun.star.beans.PropertyValue
'sUrl1$ = "file:///M:/Homepage/Preislisten/listeF.csv"
'sUrl1$ = "file:///C:/xampp/htdocs/aserver/AAA/AAApflugi/listen/listeF.csv"
sUrl1$ = "file:///C:/Users/hz/Desktop/liste_F_1.csv"
args7(0).Name = "Overwrite"
args7(0).Value = TRUE
args7(1).Name = "FilterName"
args7(1).Value = "Text - txt - csv (StarCalc)"
args7(2).Name = "FilterOptions"
args7(2).Value = "59,34,76,1,,0,true,true,true"
Dok.storeAsURL(sUrl1$, args7())
rem Shell("D:\perl\bin\perl.exe ftp-upload-CSV_listen.pl",1)
Dok.close(false)
end sub
Grüße, Hago