You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
throw System.ArgumentException: Sheet index (0) is out of range (no sheets).
/// <summary>
/// Put objects in the sheet with specified zero-based index.
/// </summary>
/// <typeparam name="T">Target object type</typeparam>
/// <param name="objects">The objects to save.</param>
/// <param name="sheetIndex">The sheet index, default is 0.</param>
/// <param name="overwrite"><c>true</c> to overwrite existing rows; otherwise append.</param>
public void Put<T>(IEnumerable<T> objects, int sheetIndex = 0, bool overwrite = true)
{
if (Workbook == null) Workbook = new XSSFWorkbook();
var sheet = Workbook.GetSheetAt(sheetIndex);
Put(sheet, objects, overwrite);
}
The second line in the method needs to judge the NumberOfSheets property first. When it‘s value is greater than 0, the GetSheetAt method is called, otherwise, the CreateSheet method is called.
The text was updated successfully, but these errors were encountered:
throw System.ArgumentException:
Sheet index (0) is out of range (no sheets)
.The second line in the method needs to judge the
NumberOfSheets
property first.When it‘s value is greater than
0
, theGetSheetAt
method is called, otherwise, theCreateSheet
method is called.The text was updated successfully, but these errors were encountered: