![]() |
| 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é. | |||||||
|
|||||||
| OpenOffice Forum d'entraide sur OpenOffice.org. Avant de poster : La F.A.Q OpenOffice |
![]() |
|
|
Outils de la discussion |
|
|
#1 (permalink) |
|
Membre régulier
![]() Date d'inscription: juillet 2004
Messages: 130
|
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
Dernière modification par stargates ; 05/09/2008 à 16h45 |
|
|
|
![]() |
![]() |
||
[Calc] problème insertion de donnes dans textield ou numeric
|
||
| Outils de la discussion | |
|
|