Vincent Mollimard a �crit :
Bonjour,
Je cherche a coder une fonction bool�enne qui me renvoit vrai si une cellule est en arri�re plan transparent. Depuis quelques heures, je parcours quelques docs mais je coince. Il y a une fonction de l'api qui fait �a mais je n'arrive pas � l'utiliser :
**************
Function EstTransparent( <r�f�rence cellule> As <le type qui va bien>) As Boolean
EstTransparent =ThisComponent.currentController.activeSheet.getCellRangeByName(<r�f�rence cellule>).IsCellBackgroundTransparent
End Function
**************
Ca tombe bien, car IsCellBackgroundTransparent est bool�en.Mais comment faire r�f�rence � une cellule particuli�re ? Le but est de pouvoir utiliser la fonction dans une formule de cellule, typiquement un truc du genre :
=si(esttransparent(B5);"transparent";"pas transparent")
Comment passer le param�tre qui r�f�rence la cellule
Bonsoir,
J'utilise la m�thode d'�criture dans une cellule pour pouvoir relire ensuite :
Sub Macro1
Dim oDocument As Object, oSheet As Object, oCell As Object
Dim Col as Integer, Lig as Integer
Dim EstTransparent as Boolean
oDocument = ThisComponent
oSheet = oDocument.Sheets.getByName("Feuille1")
EstTransparent =ThisComponent.currentController.activeSheet.getCellRangeByName("a1").IsCellBackgroundTransparent
Col=1
Lig=0
oCell = oSheet.getCellByPosition(Col,Lig)
oCell.setValue(Abs(EstTransparent))
End Sub
Dans cet exemple je teste la cellule A1 de la Feuille1 et je retourne 0 (False) ou 1 (True) dans la cellule B1.
Ensuite, dans une autre cellule :
=SI(B1=1;"Transparent";"Pas transparent")
J'esp�re r�pondre � ta question
Bon surf Christian
-- Visitez http://christianwtd.free.fr/ pour d�buter avec Calc, d'OpenOffice.org
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
