Alter the code slightly.
Private Sub UpdateChart(ChartNum As Integer)
Dim currentchart As Chart, Fname As String
Set currentchart = Sheets("Portfolio").ChartObjects(ChartNum).Chart
currentchart.Parent.Width = 400
currentchart.Parent.Height = 200
' Save chart as GIF
Fname = ThisWorkbook.Path & Application.PathSeparator & "temp.gif"
currentchart.Export Filename:=Fname, FilterName:="GIF"
stop
' Show the chart
Image1.Picture = LoadPicture(Fname)
End Sub
The stop command will pause the running program and take you to the vbe.
Use an file explorer window to check the file size of the exported file.
then use F5 to continue code running
Bookmarks