%

% Copyright 2017 The MathWorks, Inc.
function clearRange(this, workbook)
    import xls.internal.Range;
    filename = char(this.Filename);
    if ismember(this.Sheet, workbook.SheetNames)
        sheet = workbook.getSheet(char(this.Sheet));
        existingRange = string.empty;
        if strlength(this.Range) > 0
            existingRange = Range.fixIfPointRange(this.Range, sheet.usedRange);
        end
        sheet.clear(existingRange{:});
        workbook.save(filename);
    end
end
