View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
CG Rosen CG Rosen is offline
external usenet poster
 
Posts: 18
Default Image on userform from picture in a worksheet

Hi Group,

The code below loads a chart from a worksheet into an image in a userform.
Is it at all possible to use the some approach to load a picture inserted in
a
worksheet into the userform image?

Brgds

CG Rosén

Set CurrentChart = Sheets("Sheet1").ChartObjects(1).Chart
'Save chart as GIF
Fname = ThisWorkbook.Path & Application.PathSeparator & "temp.gif"
CurrentChart.Export Filename:=Fname, FilterName:="GIF"

'Show the chart
UserForm1.Image1.Picture = LoadPicture(Fname)

Kill (ThisWorkbook.Path & Application.PathSeparator & "temp.gif")