Bonjour Pierres-yves,
Merci de t’intéresser à mon problème.
Je ne comprends rien à LIBO, car de mon côté, dans comptes3.ods je vois ma macro :
REM ***** BASIC *****
option explicit
sub InsererPA
dim aSheet as object
dim oSheet as object
dim sNbrePA as string
dim sPremiereLigneLibre as string
dim document as object
dim dispatcher as object
oSheet = thiscomponent.sheets.getByName(“PRELEV_AUTO”)
sNbrePA = oSheet.getCellRangeByName(“F25”).string
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService(“com.sun.star.frame.DispatchHelper”)
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = “ToPoint”
args1(0).Value = “$PRELEV_AUTO.$A$1:$E$” & sNbrePA
REM args1(0).Value = “$PRELEV_AUTO.$A$1:$E$10”
dispatcher.executeDispatch(document, “.uno:GoToCell”, “”, 0, args1())
dispatcher.executeDispatch(document, “.uno:Copy”, “”, 0, Array())
dim args2(0) as new com.sun.star.beans.PropertyValue
aSheet = thiscomponent.sheets.getByName(“SAISIE_COMPTES”)
sPremiereLigneLibre = aSheet.getCellRangeByName(“O1008”).string
args2(0).Name = “ToPoint”
args2(0).Value = “$SAISIE_COMPTES.$A$”& sPremiereLigneLibre
rem args2(0).Value = “$SAISIE_COMPTES.$A$50”
dispatcher.executeDispatch(document, “.uno:GoToCell”, “”, 0, args2())
dispatcher.executeDispatch(document, “.uno:Pasteunformatted”, “”, 0, Array())
end sub