Run-time error 1004 with microsoft graph

flofi

Registered User.
Local time
Today, 11:51
Joined
Sep 20, 2004
Messages
15
Hi

I'm using a report with a Microsoft Graph 2000 chart on it. On this graph I'm setting some data labels on and off. This works well when opening the report for the first time. If I open it a second time with the same data it works well, too. But if I open it with different data (having fewer series) I get Run-time error '1004': Unable to set the HasDataLabel property for the Point class. Between the sessions I close the report completely. When I close the application completely and restart it then for the first time everything works well again!? Does the report save any data even if it is closed? Another surprinsing effect: It happens only if I open the report in print preview mode. But in between I closed the print preview so to me the report must be closed then...

Code:
With cht.SeriesCollection(1)
    For i = 1 to .Points.count - n
        .Points(i).HasDataLabel = False
        ...
    Next i
End With
Thanks for help

flofi
 
Last edited:
Hi again

I was able to come a bit closer to the error, but could not solve it yet:

I'm using a table with 5 predefined series on it. Before creating the chart I update the table and then some series may stay blank (Null). So I always have 5 SeriesCollections but they do not always contain Points.

1st problem:
As I try to count the Points or change their DataLabel I get an error. How can I check if the series is empty?

2nd problem:
As I change the data for the chart and update the table so the table has less rows than before the chart seems to remember tha maximum number of rows. So the SeriesCollection(i).Points.Count is larger than the table. How can I make the chart forget previous data?

Thanks for any help

flofi
 

Users who are viewing this thread

Back
Top Bottom