12 messages in org.openoffice.fr.progRe: [prog] Re: Feuille courante dans...
FromSent OnAttachments
AladdinApr 26, 2007 10:07 am 
Francois GattoApr 26, 2007 11:03 am 
AladdinApr 27, 2007 1:28 am 
Philippe AllartApr 27, 2007 3:26 am 
AladdinMay 9, 2007 6:38 am 
AladdinMay 10, 2007 7:03 am 
Francois GattoMay 10, 2007 10:08 am 
AladdinMay 11, 2007 3:01 am 
steveMay 11, 2007 3:10 am 
AladdinMay 11, 2007 5:54 am 
steveMay 11, 2007 6:08 am 
AladdinMay 14, 2007 5:59 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] Re: Feuille courante dans une fonction ?Actions...
From:Aladdin (alad@altern.org)
Date:May 11, 2007 3:01:27 am
List:org.openoffice.fr.prog

J'ai testé avec =MYFUNC("parametre1","parametre2",CELLULE("Sheet")) mais cela ne fonctionne pas, on dirait qu'il ne connait pas thisComponent au chargement du fichier.

Function myfunc(param As String, param2 As String, index As Integer) ... thisComponent.Sheets.getByIndex(index - 1) ... End Function

Même résultat en passant par StarDesktop.CurrentComponent.

Comment faire une fonction personnalisée qui fait référence à la feuille où la fonction est appelée ?

!!! Je ne comprends pas très bien. Si c'est à partir de la feuille active, quelle référence veux-tu appeler ?

Sinon, quelque chose comme ci-dessous doit fonctionner avec une saisie de la forme : =MAFONCTION(32;45;"Feuille2")

function MaFonction( dPar1 as double, sPar2 as string, sName as string ) dim oSheet as object oSheet = thisComponent.getSheets().getByName( sName ) with oSheet .getCellByPosition( 5, 10 ).value = dPar1 .getCellByPosition( 5, 11 ).string = sPar2 end with end function

Le problème survient au chargement du document lorsque je fais appel à ma fonction personnalisée dans les différentes feuilles.

Function myfunc(param As String, param2 As String, index As Integer) ... thisComponent.Sheets.getByIndex(index - 1) ... End Function

Il ne connait pas thisComponent, j'ai regardé avec xray StarDesktop mais tout les objets sont nuls.

Comment fait on pour accéder à la feuille où la fonction personnalisée est appelée lors du chargement du document ? Etant donnée que thisComponent est NULL.

Merci à vous.