I have the following code that sets the x axis so that the x axis is set to the years located in "=Sheet1!$F$1:$N$1"
.SeriesCollection(1).XValues = "=Sheet1!$F$1:$N$1"
Now the range of years will always be in the first row (header row) and will start cell F1, however the number of years will be dynamic. So I need to set .SeriesCollection(1).XValues to a dynamic range. I am using automation from within vb.net to create the graph. in an external Excel spreadsheet.