umya-spreadsheet
umya-spreadsheet copied to clipboard
`Spreadsheet::read_sheet_by_name` or `Worksheet::read`
When initialising lazily, one must initialise a sheet in order to interact with it. Currently that requires sheet index.
use get_sheet_by_name_mut(sheetname)
That's what I'm doing but I get a panic which says that I must read sheet first, before inserting rows.
That's what I'm doing but I get a panic which says that I must read sheet first, before inserting rows.
I guess you were using non-mut version
I guess you were using non-mut version
Nope
pub(crate) fn get_sheet_mut(&mut self, sheet_name: &str) -> Result<&mut Worksheet> {
self.book
.get_sheet_by_name_mut(sheet_name)
.map_err(|_| SheetStorageError::FailedToGetSheet.into())
}
I have checked the relevant sources and cannot find the cause. Can you tell us where the panic occurred?
I'll see if I can make a better, more comprehensive example later, but for now, this:
reader::xlsx::read_lazy
get_sheet_by_name_mut
get_cell_by_column_and_row_mut
set_value
writer::xlsx::write
Sorry it took so long to respond. I tried the above procedure with the latest version and did not encounter any errors. Please check again with the latest version.