Hi
I'm not too sure what is going on here. I have a macro that produces a
couple of charts from some data in a worksheet. One of the charts needs to
be formatted as it will be copied to a Word document for presentation.
Having set the macro up so the chart format/size etc is correct I added a
line to turn off screen updating to avoid flicker and to speed up the macro.
However, as soon as I ran this revised macro the x axis labels appeared over
the x-axis labels appeared on top of the x-axis title. Thinking I had messed
up somewhere I commented out the screen updating line so I could step through
the code to see where the problem occurred - only it didn't, the chart
appeared fine. I have tried both ways a couple of times but it seems that if
screen updating is off the chart sizing does not work properly. Does anybody
have any ideas???? I am using Excel 2002 on a Windows XP Pro machine. The
code I use to size the chart is below:
With cht
'Determine which template to use
If strType = TO_DATA Then
strChartTemp = TO_TEMP
ElseIf strType = MC_DATA Then
strChartTemp = MC_TEMP
Else
MsgBox INVALID_DATA, vbExclamation, "Invalid Data"
wbkRegress.Close savechanges:=False
Exit Sub
End If
.ApplyCustomType ChartType:=xlUserDefined, TypeName:= _
strChartTemp
'Set the size of the chart object
With .Parent
.Height = 210.75
.Width = 339.75
.Border.LineStyle = 0
End With
'Set the size and position of the chart's plot area
With .PlotArea
.Top = 0
.Left = 23
.Height = 194
.Width = 325
End With
End With
Bookmarks