I am completely new for openoffice and I desperately


I have a folder "reports" that contains many calc files 20150401, 20150402, 20150403....(*.ods), each file has a spreadsheet called "sales".
I want to copy each spreadsheet "sales" of each file, to a unique file called "monthconsolidate.ods", with the name of the file copied .
I found this thread viewtopic.php?f=9&t=46200 , but the macro consolidate information in one sheet... and the code is very confused for me.
In ExcelVBA would be like this
Code: Select all
Sub Promedio(mySourcePath)
Dim MyObject As New Scripting.FileSystemObject
Dim mySource As Folder
Dim Numero
Numero = 0
Set mySource = MyObject.GetFolder(mySourcePath) ' cargo en el objeto todos los archivos del directorio
For Each myFile In mySource.Files ' para cada elemento del objeto = archivos en la carpeta
If Right(myFile.Name, 4) = ".xls" Then ' |
MsgBox myFile.Name ' pinto el nombre
Workbooks.Open Filename:=mySourcePath & myFile.Name ' abro ese documento de excel
Sheets("Hoja1").Activate ' activo la hoja 1
Range("A1:P1").Copy ' copio el rango de celdas A1:P1
'Vale = Cells(1, 1).Value
ThisWorkbook.Activate ' activa el libro que tiene abierto actualmente
Sheets("Hoja1").Activate ' activa la hoja 1
Range("A" & (Numero + 1)).Select ' selecciona la celda A1, A2, A3, según cambia 'numero' en cada interacción del bucle
ActiveSheet.Paste ' pega
Workbooks(myFile.Name).Close ' cierra el documento de excel que abrió
Numero = Numero + 1 ' vamos a por otro documento :)
End If
Next
End Sub

Please help me with this
if anybody has a solution with this;
It's most welcome !
Thanks. blessings
PD: Sorry for my english