Bonsoir,
J'ai une userform dans laquelle j'ai incorporé 1 frame pour afficher un graphique .Cela fonctionne lorsque je click sur la frame , le graphique s'affiche mais je voudrais qu'il s'affiche à l'ouverture de l'userform .
Auriez vous une solution à me proposer .
Merci d'avance
Private Sub Frame2_click()
Set g = Sheets("graphique").ChartObjects(1).Chart
fichier = ActiveWorkbook.Path & "\" & "graphe1.gif"
g.Export Filename:=fichier, FilterName:="GIF"
Frame2.Picture = LoadPicture(fichier)
End Sub
A ta place, j'essaierais de mettre ce code dans l'événement Activate de ton UserForm.
Code:
Private Sub UserForm_Activate()
Set g = Sheets("graphique").ChartObjects(1).Chart
fichier = ActiveWorkbook.Path & "\" & "graphe1.gif"
g.Export Filename:=fichier, FilterName:="GIF"
Frame2.Picture = LoadPicture(fichier)
End Sub