bonsoir Jack
merci pour ton message
l'adaptation pour afficher un titre
With Cht
.Type = C.chChartTypeColumnClustered 'type de graphique:Barres
.HasLegend = True 'permet l'affichage des légendes
.Legend.Position = chLegendPositionBottom 'afichage des légendes sous le graphique
.HasTitle = True
.Title.Caption = 'mon titre' 'Label1
.Title.Font.Color = RGB(255, 0, 255)
.Title.Font.Underline = True
.Title.Font.Bold = True
.Title.Font.Size = 14
.Title.Position = chTitlePositionTop
End With
pour l'impression en mode paysage
Private Sub CommandButton2_Click()
Dim Gr As OWC.ChartSpace
Dim Largeur As Long, Hauteur As Long
Dim Ws As Worksheet
Dim nomImage As String
nomImage = 'C:\\grapheTemporaire.gif'
Largeur = 560
Hauteur = 480
Application.ScreenUpdating = False
'export du ChartSpace au format image Gif
Set Gr = Me.ChartSpace1
Gr.ExportPicture nomImage, 'gif', Largeur, Hauteur
'ajout d'une feuille dans le classeur , pour contenir l'image
'qui va etre imprimée
Set Ws = Worksheets.Add
Ws.PageSetup.Orientation = xlLandscape
Ws.Pictures.Insert(nomImage).Select
Ws.PrintOut 'impression
Application.DisplayAlerts = False
Ws.Delete 'suppression feuille
Application.DisplayAlerts = True
Kill nomImage 'suppression image
Application.ScreenUpdating = True
End Sub
bonne soirée
MichelXld
Message édité par: michelxld, à: 09/02/2006 19:52