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 : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
 
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