Paolo Mantovani ha scritto:
Ciao Beppe,
Alle 07:35, giovedì 23 agosto 2007, beppe ha scritto:
Ho provato diverse soluzioni per copiare alcune celle con le formule,
in questo caso di esempio vorrei copiare le celle: D1:F1 incollandole
partendo dalla posizione D2.
Mi da sempre questo errore:
Errore di runtime basic.
Si e' verificata un'eccezione
Type: com.sun.star.lang.IllegalArgumentException
Message: cannot coerce argument type during corereflection call!.
Qualche idea?
Non devi passare un oggetto range ma una struttura RangeAddress:
oRangeSrc = oSheet.getCellRangeByName("D1:F1").RangeAddress
saluti
Paolo M
Grazie
Modificata come suggerito sia oCell.Dest che oRange.Src e funziona!!!
Come faccio a trovare di ogni oggetto quali paramentri passare?
Avevo gia' guardato qui:
http://api.openoffice.org/docs/common/ref/com/sun/star/sheet/XCellRangeMovement.html#copyRange
copyRange
void
copyRange( [in] ::com::sun::star::table::CellAddress aDestination,
[in] ::com::sun::star::table::CellRangeAddress aSource );
The source cell range keeps unchanged.
Parameter aDestination
the address of the top left cell of the destination range.
Parameter aSource
the cell range which will be copied.
ma non avevo capito che dovevo aggiungere sia .CellAddress che .RangeAddress
alle mie variabili.
ciao.
Beppe
Sub main
Dim oSheet as Object
Dim oCell As Object
Dim oCellDest
Dim oRangeSrc
oSheet = ThisComponent.Sheets.getByIndex( 0 )
oCellDest = oSheet.GetCellByPosition( 3, 1 ).CellAddress
oRangeSrc = oSheet.getCellRangeByPosition(3, 0, 5, 0).RangeAddress
oSheet.CopyRange(oCellDest, oRangeSrc)
End sub
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]