Forum des développeurs  

Le forum de référence en programmation et développement. Articles, cours et tutoriels du débutant au chef de projet et DBA confirmé.
Précédent   Forum des développeurs > Hardware, Systèmes et Logiciels > Autres Logiciels > OpenOffice

OpenOffice Forum d'entraide sur OpenOffice.org. Avant de poster : La F.A.Q OpenOffice

Réponse
 
Outils de la discussion
Vieux 02/09/2008, 16h27   #1 (permalink)
Membre régulier
 
Date d'inscription: juillet 2004
Messages: 130
Par défaut [Calc] problème insertion de donnes dans textfield ou numeric

Bonjour,



J'ai un petit problème pour insérer les valeurs des colonnes de calc
dans un textfield ou numericfield .
Dans la procédure main cela fonctionne mais pas dans la procédure
NaviguerPos()

les variables ont bien les bonnes valeurs mais rien n'est transmis dans la
boite de dialogue
Voici le code

Code :
REM  *****  BASIC  ***** 

' Option Explicit 
Dim i as integer 
Sub Main() 
Dim Dlg As Object, bibli as Object 
Dim monDialogue As Object 
Dim champArticle As Object, article As String 
Dim champPrixCol As Object, PrixCol As Integer 
Dim champPrixLid As Object, Prixlid As Integer 
Dim champPrixGb As Object, PrixGb As integer 

i = 10 
bibli = DialogLibraries.GetByName("Standard") 
monDialogue = bibli.GetByName("dlgComparatif") 
Dlg = CreateUnoDialog(monDialogue) 
champArticle = Dlg.GetControl("txtArticles") 
champArticle.Text = thisComponent.Sheets.getByIndex(0).getCellRangeByN ame("A" & i).string 
article = champArticle.Text 
champPrixCol = Dlg.GetControl("nfprixcol") 
champPrixCol.Value = thisComponent.Sheets.getByIndex(0).getCellRangeByN ame("E" & i).value 
PrixCol = champPrixCol.Value 
champPrixLid = Dlg.GetControl("nfPrixLidl") 
champPrixLid.Value = thisComponent.Sheets.getByIndex(0).getCellRangeByN ame("F" & i).value 
PrixLid = champPrixLid.Value 
champPrixGb= Dlg.GetControl("nfprixGb") 
champPrixGb.Value =  thisComponent.Sheets.getByIndex(0).getCellRangeByN ame("G" & i).value 
PrixGb = champPrixGb.Value 
If PrixCol <= PrixLid And PrixCol <= PrixGb then 
     thisComponent.Sheets.getByIndex(0).getCellRangeByN ame("E" & i).CellBackColor = RGB(200, 0, 0) 
End If 
If PrixGb <= PrixCol And PrixGb <= PrixLid then 
    thisComponent.Sheets.getByIndex(0).getCellRangeByN ame("G" & i).CellBackColor = RGB(200, 0, 0) 
End If 
If PrixLid <= PrixCol And PrixLid <= PrixGb then 
    thisComponent.Sheets.getByIndex(0).getCellRangeByN ame("F" & i).CellBackColor = RGB(200, 0, 0) 
End If 


Dlg.Execute 


End Sub 
Rem Navigation dans le classeur 
Sub NaviguerPos() 
Rem Déclaration des variables 
Dim Dlg As Object, bibli as Object 
Dim monDialogue As Object 
Dim btnSuivant as Object 
Dim champArticle As Object, article As String 
Dim champPrixCol As Object, PrixCol As Integer 
Dim champPrixLid As Object, Prixlid As Integer 
Dim champPrixGb As Object, PrixGb As integer 

Rem Assignation des variables 
bibli = DialogLibraries.GetByName("Standard") 
monDialogue = bibli.GetByName("dlgComparatif") 
Dlg = CreateUnoDialog(monDialogue) 
btnSuivant = Dlg.GetControl("btnSuivant") 

i = i + 1 
champArticle = Dlg.GetControl("txtArticles") 
champArticle.Text = thisComponent.Sheets.getByIndex(0).getCellRangeByN ame("A" & i).string 
article = champArticle.Text 
champPrixCol = Dlg.GetControl("nfprixcol") 
champPrixCol.Value = thisComponent.Sheets.getByIndex(0).getCellRangeByN ame("E" & i).value 
PrixCol = champPrixCol.Value 
champPrixLid = Dlg.GetControl("nfPrixLidl") 
champPrixLid.Value = thisComponent.Sheets.getByIndex(0).getCellRangeByN ame("F" & i).value 
PrixLid = champPrixLid.Value 
champPrixGb= Dlg.GetControl("nfprixGb") 
champPrixGb.Value =  thisComponent.Sheets.getByIndex(0).getCellRangeByN ame("G" & i).value 
PrixGb = champPrixGb.Value 
If PrixCol <= PrixLid And PrixCol <= PrixGb then 
     thisComponent.Sheets.getByIndex(0).getCellRangeByN ame("E" & i).CellBackColor = RGB(200, 0, 0) 
End If 
If PrixGb <= PrixCol And PrixGb <= PrixLid then 
    thisComponent.Sheets.getByIndex(0).getCellRangeByN ame("G" & i).CellBackColor = RGB(200, 0, 0) 
End If 
If PrixLid <= PrixCol And PrixLid <= PrixGb then 
    thisComponent.Sheets.getByIndex(0).getCellRangeByN ame("F" & i).CellBackColor = RGB(200, 0, 0) 
End If 
End Sub
une idée merci

Dernière modification par stargates ; 05/09/2008 à 16h45
stargates est déconnecté   Envoyer un message privé Réponse avec citation
Réponse

Précédent   Forum des développeurs > Hardware, Systèmes et Logiciels > Autres Logiciels > OpenOffice



Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are non
Pingbacks are non
Refbacks are non
Navigation rapide


Fuseau horaire GMT +1. Il est actuellement 13h50.


Publiez vos articles, tutoriels et cours et rejoignez-nous dans l'équipe de rédaction du club d'entraide des développeurs francophones. Nous contacter
Copyright 2000-2008 www.developpez.com - Legal informations