VBA processes chart,SeriesCollection.Values errors when the data selection of the original chart exceeds the real data area.

excel has a chart, line chart.
assume that the data selection is Range ("B1:B10")
if cell B10 is empty,
reads Sheet1.ChartObjects (1) .Chart.SeriesCollection (1) .values Times error.

I guess the reason is the blank lines at the end of
, for example, B10 is empty and empty, but this line does not exist. Reading is wrong.
but why manual drawing can be selected, vba read error.

in addition

1. How to solve this problem?

2. How does vba get the selection range? of chart data

Mar.14,2021
Menu