D
David Adamson
Can some kind sole please help me here.
I am display 13 charts one at a time into a userform via a drop down box
titled: ChartType
I have adapted the coding from John Walkenbach's site
http://j-walk.com/ss/excel/tips/tip66.htm
But the problem I get is that it displays the wrong chart. It works fine
for Chart 1 but after that it just seams to go loopy when I try and load in
another chart
Any suggestions would be greatly appreciated.
--------------------------------------------
Dim ChartNo As Integer
Private Sub GetChart_Click()
ChartNo = 0
CheckValue = Charts.ChartType.ListIndex + 1
ChartNo = CheckValue
UpdateChart
End Sub
Private Sub UpdateChart()
Set CurrentChart = Sheets("Charts").ChartObjects(ChartNo).Chart
CurrentChart.Parent.Width = 420
CurrentChart.Parent.Height = 190
' 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
I am display 13 charts one at a time into a userform via a drop down box
titled: ChartType
I have adapted the coding from John Walkenbach's site
http://j-walk.com/ss/excel/tips/tip66.htm
But the problem I get is that it displays the wrong chart. It works fine
for Chart 1 but after that it just seams to go loopy when I try and load in
another chart
Any suggestions would be greatly appreciated.
--------------------------------------------
Dim ChartNo As Integer
Private Sub GetChart_Click()
ChartNo = 0
CheckValue = Charts.ChartType.ListIndex + 1
ChartNo = CheckValue
UpdateChart
End Sub
Private Sub UpdateChart()
Set CurrentChart = Sheets("Charts").ChartObjects(ChartNo).Chart
CurrentChart.Parent.Width = 420
CurrentChart.Parent.Height = 190
' 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