Ciao, ho un problema con una macro per copiare i dati dal file "fattura" al
file "dati, vorrei modificarla per aggiungere altre 3 colonne al range
copiato, al posto dell'intervallo "A13:I44" vorrei che mi copiasse "A13:N44.
Grazie in anticipo a chi mi può aiutare. Nicola
Sub Nico
Dim aFileProp(0) As New com.sun.star.beans.PropertyValue
oDoc = ThisComponent
oSheet = oDoc.Sheets.getByName("Foglio1")
oCopyRange = oSheet.getCellRangeByName("A13:I44")
'oDoc.CurrentController.Select(oRange)
'oTransferable = oDoc.CurrentController.getTransferable()
oDoc =
StarDesktop.LoadComponentFromURL(ConvertToURL("/home/nicola/fatture/dati.ods"),
"_default", 0, aFileProp())
oSheet = oDoc.Sheets.getByName("Foglio1")
oCellCursor = oSheet.createCursor()
oCellCursor.gotoEndOfUsedArea(False)
nEndRow = oCellCursor.getRangeAddress().endRow + 1
oPasteRange = oSheet.getCellRangeByPosition(0, nEndRow, 8, nEndRow +
(44 - 13)) '0=A 8=I
'oDoc.CurrentController.Select(oRange)
'oDoc.CurrentController.insertTransferable(oTransferable)
oPasteRange.DataArray = oCopyRange.DataArray
For i = nEndRow + (44 - 13) To nEndRow Step -1
If oSheet.getCellByPosition(0, i).Type =
com.sun.star.table.CellContentType.EMPTY Then
oSheet.getRows.removeByIndex (i, 1)
End If
Next i
oDoc.store()
oDoc.close(false)
End Sub
--
Come cancellarsi: E-mail [email protected]
Problemi? http://it.libreoffice.org/supporto/mailing-lists/come-cancellarsi/
Linee guida per postare + altro:
http://wiki.documentfoundation.org/Local_Mailing_Lists/it
Archivio della lista: http://listarchives.libreoffice.org/it/users/
Tutti i messaggi inviati a questa lista vengono archiviati pubblicamente e non
sono eliminabili