Hi all
I have a half donut chart with a grouped shape. I found a code to show the chart on a userform, but the grouped shape does not show up.
How can I show both the chart and the shape on the userform using VBA?
The code for creating the chart image in a userform is:
Private Sub OptionButton1_Click()
UpdateChart 1
End Sub
Private Sub OptionButton2_Click()
UpdateChart 2
End Sub
Private Sub UpdateChart(ChartNum As Integer)
Dim currentchart As Chart, Fname As String
Set currentchart = Sheets("Charts").ChartObjects(ChartNum).Chart
currentchart.Parent.Width = 100
currentchart.Parent.Height = 100
' Save chart as GIF
Fname = ThisWorkbook.Path & Application.PathSeparator & "temp.gif"
currentchart.Export Filename:=Fname, FilterName:="GIF"
' Show the chart
Image1.Picture = LoadPicture(Fname)
End Sub
Thanks
Bookmarks