Précédent   Forum des professionnels en informatique > Logiciels > Microsoft Office > Access > Contribuez
Contribuez Access : Vos contributions. Postez ici vos codes sources, conseils, astuces et autres propositions. Ce forum n'est pas un forum technique mais destiné aux contributions pour www.developpez.com
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 01/12/2005, 10h04   #1
Membre régulier
 
Inscription : juillet 2004
Messages : 118
Détails du profil
Informations personnelles :
Âge : 30

Informations forums :
Inscription : juillet 2004
Messages : 118
Points : 78
Points : 78
Par défaut Réaliser un graphique sous Excel

<QUESTION>
Coment faire un graphique dans excel avec access
</QUESTION>
<REPONSE>
Il faut référencer la bibliothèque Excel au prélable (Outils/Références)
Code :
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
 
‘Déclaration des Variables d’instanciation d’Excel
Dim appexcel As Excel.Application
Dim wbexcel As Excel.Workbook
Dim wsexcel As Excel.Worksheet
Dim srexcel As Excel.Range
Dim chexcel As Excel.Chart
 
‘Création des instances
Set appexcel = CreateObject("Excel.Application")
Set wbexcel = appexcel.Workbooks.Open(PathDuFicherExcel)
Set wsexcel = wbexcel.Sheets(NomDeLaFeuilleDeCalcul)
Set srexcel = wbexcel.Worksheets(1).Range("a1").CurrentRegion
Set chexcel = appexcel.Charts.Add
 
‘Création du graphique 
chexcel.ChartType = xlLineMarkers
chexcel.SeriesCollection.NewSeries
chexcel.SeriesCollection(1).XValues = "Plage des X pour la serie 1"
chexcel.SeriesCollection(1).Values = "Plage des Y pour la serie 1"
chexcel.SeriesCollection(1).Name = "Nom de la serie 1"
chexcel.Location Where:=xlLocationAsObject, Name:="NomDeLaFeuilleDeCalcul"
ActiveWindow.Visible = False
Windows(NomDuFichierExcel).Activate
 
‘Libération des instances
Set cellexcel = Nothing
Set chexcel = Nothing
Set srexcel = Nothing
Set wsexcel = Nothing
Set wbexcel = Nothing
Set appexcel = Nothing
 
End Sub
[/quote]
vdbadr est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 30/05/2006, 15h37   #2
Rédacteur

 
Avatar de Tofalu
 
Christophe Warin
Inscription : octobre 2004
Messages : 8 635
Détails du profil
Informations personnelles :
Nom : Christophe Warin
Âge : 28

Informations forums :
Inscription : octobre 2004
Messages : 8 635
Points : 13 718
Points : 13 718
Il faudrait aller plus loin et proposer un exemple avec exportation des données
Tofalu est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 21h55.


 
 
 
 
Partenaires

Hébergement Web