7 messages in org.openoffice.fr.progRe: [prog] [Basic] Format des nombres
FromSent OnAttachments
Anthony BenoistJun 27, 2006 12:32 am 
Bernard MarcellyJun 27, 2006 1:31 am 
Anthony BenoistJun 27, 2006 1:49 am 
emma...@fr.thalesgroup.comJun 27, 2006 1:51 am 
Anthony BenoistJun 27, 2006 1:59 am 
Bernard MarcellyJun 27, 2006 3:10 am 
Anthony BenoistJun 28, 2006 12:12 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [prog] [Basic] Format des nombresActions...
From:Anthony Benoist (anth@student.ecp.fr)
Date:Jun 27, 2006 1:49:12 am
List:org.openoffice.fr.prog

Bernard Marcelly a écrit :

On pourrait peut-être t'aider à comprendre ton erreur si tu nous montrais comment tu t'y prends. Fais-nous un exemple simple: une macro qui renvoie toujours la valeur 2,458.

Là j'ai un peu honte ... Ne trouvant pas de fonction dans l'aide, et comme je ne maîtrise pas dans la programmation Basic la relation programme Basic/feuille Calc, j'ai adapté ce que me donne l'enregistrement d'une macro.

Voilà ce que ça donne :

rem define variables [Lgn 1] dim document as object [Lgn 2] dim dispatcher as object

rem get access to the document [Lgn 3] document = ThisComponent.CurrentController.Frame [Lgn 4] dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

[Lgn 5] dim args1(0) as new com.sun.star.beans.PropertyValue [Lgn 6] args1(0).Name = "ToPoint" [Lgn 7] args1(0).Value = "$B$7" [Lgn 8] dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())

[Lgn 9] dim args2(0) as new com.sun.star.beans.PropertyValue [Lgn 10] args2(0).Name = "StringName" [Lgn 11] args2(0).Value = str(resultfound.result)

[Lgn 12] dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args2())

Tout est à la ligne 11 : ce que je cherche à afficher est ce resultfound.result, qui est le résultat d'un seekgoal. Sa structure est celle-ci : dim resultfound as new com.sun.star.sheet.GoalResult '(divergence,result structure)

Si à cette ligne 11, je mets un val(resultfound.result), rien ne se passe ...