for .XLS files, it is found that wrong value is returned for any cell referencing other string cell.
Note
this error is NOT found when reading from .XLSX files processed by the exact same code (see the rust code attached below).
This error occurred using Calamine 0.21.1
Attachments
"xls_ref_String.xls" and "xlsx_ref_String.xlsx": Two excel files are exactly same in content, one is .xlsx and the other is .xls.
main.rs: rust code shows the extraction of values from the two given excel files.
use calamine::{open_workbook_auto, Reader};
use std::io::Error;
fn main() -> Result<(), Error> {
let this_sheet = "Sheet1";
println!("\n======================================================================\n");
// try both the xls and xlsx versions
for excel_file in ["xls_ref_String.xls", "xlsx_ref_String.xlsx"] {
let mut workbook = open_workbook_auto(excel_file).expect("Cannot open file");
println!("File: {:?} are: \n", excel_file);
// extracting values
if let Some(Ok(r)) = workbook.worksheet_range(this_sheet) {
for used_cell in r.used_cells() {
println!(
"\tValue: A{:?} = {:?}",
used_cell.0, used_cell.2
);
}
}
println!("\n======================================================================\n");
}
Ok(())
}
Cargo.toml: Toml file shows the used Calamine version
[package]
name = "calamine_xls_wrong_referenced_String_cells"
version = "0.1.0"
edition = "2021"
- screenshots of the excel files (same for both the xls and xlsx versions)
![excel screenshot](https://github.com/tafia/calamine/assets/5351850/0e818f2d-2e29-4479-b20b-59a99d287199)
- A snapshot of the program results.
![output scrrenshot](https://github.com/tafia/calamine/assets/5351850/71e603f7-a213-4705-bf7f-efa39674ee5b)
Description
for .XLS files, it is found that wrong value is returned for any cell referencing other string cell.
Note
this error is NOT found when reading from .XLSX files processed by the exact same code (see the rust code attached below). This error occurred using Calamine 0.21.1
Attachments
See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] calamine = "0.21.1"