Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


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 users+help@it.libreoffice.org
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

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.