Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating Chart Titles in Excel

Status
Not open for further replies.

learning2fly

Programmer
Jan 10, 2001
12
GB
Hello,

I have recently had a rather strange problem running code to insert charts.

The problem originally started as a memory problem. I am creating about 36 charts from a large amount of data and pasting these in a new worksheet.

Up to a point this ran no problem, but with a larger amount of data (and graphs) I got a 'Not enough memory' message and the program crashes.

To combat this I added the line

Application.ScreenUpdating = False

This allowed the program to run to completion but the chart title formatting no longer worked. The code for this updating is shown below:


ActiveSheet.ChartObjects("Chart" + Str(n + 1)).Activate
ActiveChart.ChartTitle.Select
Selection.AutoScaleFont = True
With Selection.Font
.Name = "Arial"
.Size = 14
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Background = xlAutomatic
End With

I don't understand why this should stop working because of the screen updating line but this is all that I changed.

I would be happy with a solution to either the memory problem or the updating titles problem as I think either will give the outcome I need.

Thanks in advance

Gordon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top