M
martien.janssen1234
Dear all
I have the following code to set the name and x and y properties of a chartseries. These need to refer to a certain worksheet (T1, T2, etc identifiedby the parameter Tsel) and to a certain range on these sheet.
..SeriesCollection(nl).Name = "='T" & TSel & "'!" & Cells(38, j).AddressLocal(ReferenceStyle:=xlR1C1)
..SeriesCollection(nl).XValues = "='T" & TSel & "'!" & Range(Cells(40, 1), Cells(40 + nr - 1, 1)).AddressLocal(ReferenceStyle:=xlR1C1)
I have used the AddressLocal property to create references in the local language. When I run the code above on an English version, the code runs fine.On a German Excel version the code fails on the second line (object failure). If I evaluate the string which is created at the righ side of the equation it seems to me OK (like ='T2'!Z40S1:Z100S1). The curious thing is that the first line works OK, so it seems there is no problem with the reference to the worksheet itself. The problem must be somewhere in the definitionof the range which spans multiple rows.
Any suggestion is appreciated
Martien
I have the following code to set the name and x and y properties of a chartseries. These need to refer to a certain worksheet (T1, T2, etc identifiedby the parameter Tsel) and to a certain range on these sheet.
..SeriesCollection(nl).Name = "='T" & TSel & "'!" & Cells(38, j).AddressLocal(ReferenceStyle:=xlR1C1)
..SeriesCollection(nl).XValues = "='T" & TSel & "'!" & Range(Cells(40, 1), Cells(40 + nr - 1, 1)).AddressLocal(ReferenceStyle:=xlR1C1)
I have used the AddressLocal property to create references in the local language. When I run the code above on an English version, the code runs fine.On a German Excel version the code fails on the second line (object failure). If I evaluate the string which is created at the righ side of the equation it seems to me OK (like ='T2'!Z40S1:Z100S1). The curious thing is that the first line works OK, so it seems there is no problem with the reference to the worksheet itself. The problem must be somewhere in the definitionof the range which spans multiple rows.
Any suggestion is appreciated
Martien