Habe mal ein bisschen auf www.oooforum.org gesucht:
Sub CopyTransposeForVera
Dim document As Object, dispatcher As Object, args3(5) As New
com.sun.star.beans.PropertyValue
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
oDesktop = createUnoService("com.sun.star.frame.Desktop")
oDocument = ThisComponent
oFrame = oDocument.CurrentController.Frame
oSheet1 = oDocument.Sheets.getByIndex(0)
oSheet2 = oDocument.Sheets.getByIndex(1)
' B1 bis B6
oFromRange = oSheet1.getCellRangeByPosition(1,0,1,6)
' A2 als Ziel-Zelle
oToCell = oSheet2.getCellByPosition(0,1)
oDocument.CurrentController.Select(oFromRange)
dispatcher.executeDispatch(oFrame, ".uno:Copy", "", 0, Array())
args3(0).Name = "Flags"
args3(0).Value = "A"
args3(1).Name = "FormulaCommand"
args3(1).Value = 0
args3(2).Name = "SkipEmptyCells"
args3(2).Value = false
args3(3).Name = "Transpose"
args3(3).Value = TRUE
args3(4).Name = "AsLink"
args3(4).Value = false
args3(5).Name = "MoveMode"
args3(5).Value = 4
oDocument.CurrentController.Select(oToCell)
dispatcher.executeDispatch(oFrame, ".uno:InsertContents", "", 0, args3())
End Sub
jetzt "nur noch" den Zugriff auf die Blätter mittels Namen umstellen...
have fun
Winfried
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]