Struct calamine::Excel [] [src]

pub struct Excel { /* fields omitted */ }

A wrapper struct over the Excel file

Methods

impl Excel
[src]

Opens a new workbook

Examples

use calamine::Excel;

assert!(Excel::open(path).is_ok());

Get all data from Worksheet

Examples

use calamine::Excel;

let mut workbook = Excel::open(path).expect("Cannot open file");
let range = workbook.worksheet_range("Sheet1").expect("Cannot find Sheet1");
println!("Used range size: {:?}", range.get_size());

Get all data from Worksheet at index idx (0 based)

Examples

use calamine::Excel;

let mut workbook = Excel::open(path).expect("Cannot open file");
let range = workbook.worksheet_range_by_index(0).expect("Cannot find first sheet");
println!("Used range size: {:?}", range.get_size());

Does the workbook contain a vba project

Gets vba project

Examples

use calamine::Excel;

let mut workbook = Excel::open(path).unwrap();
if workbook.has_vba() {
    let vba = workbook.vba_project().expect("Cannot find vba project");
    println!("References: {:?}", vba.get_references());
    println!("Modules: {:?}", vba.get_module_names());
}

Get all sheet names of this workbook

Examples

use calamine::Excel;

let mut workbook = Excel::open(path).unwrap();
println!("Sheets: {:#?}", workbook.sheet_names());