My graph has a timeline of one year. After that year the timeline needs to be updated.
To get the current year I have used the functions TODAY() and YEAR().
The function YEAR() is in cell A35 of the same sheet as the graph.
Then I used the following code to update the graph's year:
.MinimumScale = "1-1-" & Range("A35").Value
.MaximumScale = "31-12-" & Range("A35").Value
.CrossesAt = "1-1-" & Range("A35").Value
The MinimumScale updates correctly, but for some reason the code gets stuck on .MaximumScale?!
The following error message is displayed (sorry for the bad translation):
Error 1004 during execution:
Property MaximumScale of class Axis can't be initiated.
Why does my method work for .MinimumScale but not for .MaximumScale???