Bonjour,
Dans un graphe que je complete en affchant l'étiquette sur l'avant dernier piont de la courbe 3 (j'ai 3 courbes), tout cela marche for bien en Acc2000 dans les forms et les etats
tandis que sous Acc2003 (ma db en format 2000 ou format 2003), elle ne s'affiche pas sans aucun message d'erreur.
Je pense que ça doit être dû à mes déclarations d'objets qui ont changé depuis XP 2002 (ah, ce late binding !!! ...)
Je vous met le code (pour l'alléger, j'ai enlevé la partie qui nourissait les courbes et qui marche OK ) :
Merci de votre aide
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 Sub fCompleteChart(oChart As Object, numIndent As Long) ' But : ' Afficher une étiquette en fin de mesure sur la courbe 3 If IsNothing(numIndent) Then Debug.Print "pb appel fAchieveChart noIndent " Exit Sub End If Dim objOLE As Object Dim objDS Dim objChart As Chart Dim strSQL As String, strTxt As String Dim i As Long, j As Long Dim maBD As DAO.Database Dim rst As DAO.Recordset Dim intRowMax As Integer, intColMax As Integer, arrData As Variant Dim mySrs As Series, nbPts As Long Set objOLE = oChart.Object 'Accesses the OLE object Set objDS = objOLE.Application.DataSheet 'Accesses the Datasheet of the OLE object 'Set objChart = objOLE.Application.Chart 'Accesses the Chart of the OLE object Set objChart = oChart.Object.Application.Chart 'Accesses the Chart of the OLE object Debug.Print "objOLE.SeriesCollection.Count: " & objOLE.SeriesCollection.Count 'Appliquer une étiquette à l'abscisse du point X de la série 3. nbPts = objChart.SeriesCollection(3).Points.Count For i = 1 To nbPts 'mySrs.Points(i).ApplyDataLabels xlDataLabelsShowNone objChart.SeriesCollection(3).Points(i).ApplyDataLabels xlDataLabelsShowNone Next i strTxt = "300 min" & vbLf & "Essai D" 'Etiquette pour marquer l'abcisse de la fin du test '-------------------------------------------------- 'Set mySrs = objChart.SeriesCollection(3) i = objChart.SeriesCollection(3).Points.Count - 1 'Avant-dernier point =intColMax With objChart.SeriesCollection(3).Points(i) .ApplyDataLabels _ Type:=xlDataLabelsShowValue, AutoText:=True, LegendKey:=False With .DataLabel.Font '.Superscript = True '.Interior.Color = RGB(255, 255, 255) .name = "Tahoma" .size = 10 End With .DataLabel.Text = strTxt End With 'DoEvents 'Pourquoi DoEvents ? 'objOLE.Refresh Fin: Set mySrs = Nothing Set rst = Nothing Set maBD = Nothing Set objDS = Nothing Set objChart = Nothing Set objOLE = Nothing
Partager