Just a brief intro to my program. I have a series of userforms, the first one basic data is added and is entered into a spreadsheet. The next one the user chooses which machine they want -there are 5 different machines and depending on which one they choose, another userform -specific to the machine- pops up. After entering data into that userform (which exports the data to the spreadsheet) I want to grab the new results and put it on a graph, which will then display in the next userform.
Currently I can get the graph to a spreadsheet, but I can't get it to display in the userform. I used: ActiveChart.Name = "PDChart" to rename the chart and then replaced the ChartNum with it.. but it didn't work. The code I am using is below.
Any Suggestions?
Thanks
-chels
Private Sub UpdateChart()
Set CurrentChart = Sheets("Chart").PDChart.Chart
CurrentChart.Parent.Width = 470
CurrentChart.Parent.Height = 250
' 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
Currently I can get the graph to a spreadsheet, but I can't get it to display in the userform. I used: ActiveChart.Name = "PDChart" to rename the chart and then replaced the ChartNum with it.. but it didn't work. The code I am using is below.
Any Suggestions?
Thanks
-chels
Private Sub UpdateChart()
Set CurrentChart = Sheets("Chart").PDChart.Chart
CurrentChart.Parent.Width = 470
CurrentChart.Parent.Height = 250
' 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