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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run-time error '1004' - can this be related to memory issues?

Status
Not open for further replies.

Banyez

Technical User
Jul 23, 2007
7
0
0
US
Hi all. I have made a macro that does the exact same thing for 20 worksheets. I make 6 charts. Then I add a text box. I had the code working where it did everything I wanted without any problems.

I added an additional chart and now when I run the code the macro runs fine for 7 of the worksheets and then gives me an error:

"Run-time error 1004 - unable to set the name property of the font class"

This makes no sense to me since it has just successfully done it on 7 previous sheets 4 times each.

Are there limits to how many times I can run the following:


Code:
        With Chart_5.Chart.Shapes.AddLabel(msoTextOrientationHorizontal, 225, 9.75, 0, 0).TextFrame
            .Characters.Text = "XXXXXXXXXX"
            With .Characters(Start:=1, Length:=12).Font
                .Name = "Arial"
                .FontStyle = "Regular"
                .Size = 8
            End With
        End With

Very frustrated. Any thoughts would be great.

 
Additionally I just went to the end with statement to skip it on that particular chart, then I continued it, and it ran the rest of the way and terminated properly.

So I guess the question is no longer is it a memory issue, because I don't think it is.

Why would 1 chart out of the 120 give me this problem?

I know you all can't do much without more info, but perhaps there are some tricks to debugging that you might know for instances like this?

Thanks
-Banyez
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top