Series function& protect sheet in excel 2007

H

Hadi Sumoro

Dear all,

I am making an excel spreadsheet for 2007 and 2003. The way I am doing this
is making everything in excel 2007 and save is as excel 2003 (compatibility
mode). In the VBA, I wrote:

Set Ser22 = ActiveSheet.ChartObjects("Chart 2").Chart.SeriesCollection(1)
Ser22.Values = Range(Cells(1, 25), Cells(n, 25))
Ser22.XValues = Range(Cells(1, 24), Cells(n, 24))
With ActiveSheet.ChartObjects("Chart 2").Chart.Axes(xlValue)
..MinimumScale = 0
..MaximumScale = Range("D16")
End With
With ActiveSheet.ChartObjects("Chart 2").Chart.Axes(xlCategory)
..MinimumScale = 0
..MaximumScale = Range("D15")
End With

The code above controls a chart where the n is total points (dots) that is
going to be plotted. The chart is XYscatter style (only dots, no lines).

I saved it, everything works very well!

I put a mouse scroll protection (vba code) on the sheet and protect the
sheet with password. All boxes contain formulas/results are not locked.

With the protection, this sheet works fine in excel 2003, however, excel
2007 says error for:

Ser22.Values = Range(Cells(1, 25), Cells(n, 25))

It said:

Run-time error '-2147467259 (80004005)':

Method 'Values' of object 'Series' failed

Is this a bug in excel 2007? I know that I am going to save this worksheet
as excel 2007 (.xlsm I guess if I am not mistaken with the file name), but
how do I make this working?

I also made a copy and converted the new copy to 2007 version (.xlsm), it
seems that the problem still exists. I really do not have any ideas how to
solve this problem.

Please help and advice. Thank you in advance.
 

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