Hi All

I want to add a chart to a userform, and i have found a few codes and sites that offer help, but..... im having issues i just cant get it to work, currently i have this

Option Explicit
 Dim chartnum As Integer
 Private Sub UserForm_Initialize()
     chartnum = 1
     updatechart
 End Sub
 Private Sub updatechart()
     Dim CurrentChart As Chart
     Dim Fname As String
 
    
    Set CurrentChart = Sheets("Charts").ChartObjects(chartnum).Chart
     CurrentChart.Parent.Width = 390
     CurrentChart.Parent.Height = 190
     Fname = ThisWorkbook.Path & "\temp.gif"
     CurrentChart.Export Filename:=Fname, FilterName:="GIF"
     Image1.Picture = LoadPicture(Fname)
 End Sub
Which wont work, then i have looked at this site.... http://www.j-walk.com/ss/excel/tips/tip66.htm

And cant get that to work either, could somone please explain where i should be putting these codes? in a module, or directly into the userform code

Thanks

Dan