Hi everyone, I'm after some advice for working with Excel userforms. I have the below piece of code which allows me to import an image of a chart from a sheet into a Userform. While this works OK, most of my charts exist on Chart Sheets opposed to data sheets. Is there any easy work around to pull the charts from the chart sheets themselves?
Set CurrentChart = Sheets("Sheet1").ChartObjects(1).Chart
Fname = ThisWorkbook.Path & "\temp.gif"
CurrentChart.Export FileName:=Fname, FilterName:="GIF"
Image1.Picture = LoadPicture(Fname)
Set CurrentChart = Sheets("Sheet1").ChartObjects(1).Chart
Fname = ThisWorkbook.Path & "\temp.gif"
CurrentChart.Export FileName:=Fname, FilterName:="GIF"
Image1.Picture = LoadPicture(Fname)
Last edited: