Image control

G

Guest

Have code which loads a gif file to an image control. If I have a breakpoint
in the code the gif file loads beatuifully to the image sized as it should
be. If i do not have a breakpoint it appears to size somewhat at its own
will. Any suggestions why this could be? Code below.

n = ActiveSheet.ChartObjects.Count
ActiveSheet.ChartObjects(n).Height = Image1.Height '300
ActiveSheet.ChartObjects(n).Width = Image1.Width '320
.PlotArea.Left = 20
.PlotArea.Top = 15
.PlotArea.Height = Image1.Height - 30 '160
.PlotArea.Width = Image1.Width - 25 '300
If obXY.Value Then .Axes(xlCategory).AxisTitle.Top = Image1.Height
If .Axes(xlValue, xlPrimary).HasTitle = True Then
..Axes(xlValue).AxisTitle.Left = 1
If .HasTitle = True Then .ChartTitle.Top = 3
End With
Set CurrentChart = ActiveSheet.ChartObjects(n).Chart
'''Save chart as GIF
FName = ThisWorkbook.Path & Application.PathSeparator & "temp.gif"
CurrentChart.Export FileName:=FName, FilterName:="GIF"
'''Show the chart
Image1.Picture = LoadPicture(FName)
 
F

Frank Stone

hi,
check the autosize property of the image control. may sure
it is set to false.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top