In the Google Apps Script Spreadsheet Service –
Where tgt_range is a Range object, the line tgt_range.getNextDataCell(SpreadsheetApp.Direction.DOWN) generates an "Exception: Invalid argument" if the group in the sheet within which tgt_range is contained is collapsed. However, the line runs without exception if the group is expanded.
I cannot find any documentation indicating that a range must be visible/expanded in order for the .getNextDataCell(...) method to execute.
Does anyone know if this is a bug or whether the behavior is by design?