Gents,
I use a image control to load an exported image. When i use the gif or jpg i have no problems. But as soon i want to import the png file format it gives an error. When i use a Image1 and try loading a png through the image propertys it give the message invalid file.
I export the gif with a transparent background but the quality is realy poor thats why i want to use PNG
Code:
Private Sub UpdateChart()
Dim Fname As String
Dim i As Integer
Application.ScreenUpdating = False
For i = 1 To 3
Sheets("DASHBOARD").ChartObjects(i).Activate
ActiveChart.Parent.Width = 400
ActiveChart.Parent.Height = 180
' Save chart as GIF
Fname = ThisWorkbook.Path & Application.PathSeparator & i & "_temp.gif"
ActiveChart.Export FileName:=Fname, FilterName:="GIF"
Me.Controls("Image" & i).Picture = LoadPicture(Fname)
Application.ScreenUpdating = True
Next
End Sub
Bookmarks