Salut Kobaya,
ne t'inquiète pas, je ne suis pas rancunier.
Je crois que tu sais déjà que l'enregistrement des macros sous Excel est très bavard.
Ex.
Voilà ce que Excel écrit si on veut la feuille en paysage
Sub Macro2()
'
' Macro2 Macro
' Macro enregistrée le 17/09/2005 par lami
'
'
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = ""
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.787401575)
.RightMargin = Application.InchesToPoints(0.787401575)
.TopMargin = Application.InchesToPoints(0.984251969)
.BottomMargin = Application.InchesToPoints(0.984251969)
.HeaderMargin = Application.InchesToPoints(0.4921259845)
.FooterMargin = Application.InchesToPoints(0.4921259845)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 96
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
.PrintErrors = xlPrintErrorsDisplayed
End With
End Sub
En fait on n'a besoin que de
Sub Macro2()
ActiveSheet.PageSetup.Orientation = xlLandscape
End Sub
C'est pareil avec OpenOffice, lui aussi il est bavard.
Ex :
-pour écrire dans une cellule les 2 macros font la même chose
1. macro enregistée
sub test
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "StringName"
args1(0).Value = "Azerty"
dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args1())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:JumpToNextCell", "", 0, Array())
end sub
2. macro écrit
sub test2 ()
ThisComponent.Sheets.getByName("Feuille1").getCellByPosition(0,0).string="Azerty"
end sub
A+
lami20j