Struct calamine::Excel
[−]
[src]
pub struct Excel { /* fields omitted */ }
A wrapper struct over the Excel file
Methods
impl Excel
[src]
fn open<P: AsRef<Path>>(path: P) -> Result<Excel>
fn worksheet_range(&mut self, name: &str) -> Result<Range>
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());
fn worksheet_range_by_index(&mut self, idx: usize) -> Result<Range>
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());
fn has_vba(&mut self) -> bool
Does the workbook contain a vba project
fn vba_project(&mut self) -> Result<Cow<VbaProject>>
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()); }
fn sheet_names(&mut self) -> Result<Vec<&str>>
Get all sheet names of this workbook
Examples
use calamine::Excel; let mut workbook = Excel::open(path).unwrap(); println!("Sheets: {:#?}", workbook.sheet_names());