Skip to main content

WorkbookManager

Struct WorkbookManager 

Source
pub struct WorkbookManager {
    pub sheets: Vec<Sheet>,
    pub charts: Vec<Chart>,
    pub pivot_tables: Vec<PivotTable>,
    pub vba_project: Option<VbaProject>,
    pub locale: Locale,
}

Fields§

§sheets: Vec<Sheet>§charts: Vec<Chart>§pivot_tables: Vec<PivotTable>§vba_project: Option<VbaProject>§locale: Locale

Implementations§

Source§

impl WorkbookManager

Source

pub fn run_macro( &mut self, module: Option<&str>, procedure: &str, args: &[&str], ) -> Result<RunOutcome, Error>

Runs one of this workbook’s own VBA procedures

Source

pub fn run_open_events(&mut self) -> Result<RunOutcome, Error>

Runs startup macro events (Workbook_Open in ThisWorkbook then Auto_Open in standard modules).

Source§

impl WorkbookManager

Source

pub fn load_bytes(buffer: &[u8]) -> Result<Self>

Source

pub fn save_bytes(&self) -> Result<Vec<u8>>

Source

pub fn new_empty() -> Result<Self>

Source

pub fn set_locale(&mut self, locale: Locale)

Source

pub fn evaluate(&mut self) -> Result<()>

Source

pub fn find_sheet_index(&self, name_opt: Option<&str>) -> Result<usize>

Source

pub fn get_summary(&self, file_name: &str) -> WorkbookSummary

Source

pub fn ensure_capacity( &mut self, sheet_idx: usize, target_row: usize, target_col: usize, )

Source

pub fn set_cell_style( &mut self, sheet_name: Option<&str>, row: usize, col: usize, style: CellStyle, ) -> Result<()>

Source

pub fn set_range_style( &mut self, sheet_name: Option<&str>, start_row: usize, start_col: usize, end_row: usize, end_col: usize, style: CellStyle, ) -> Result<()>

Source

pub fn get_cell_style( &self, sheet_name: Option<&str>, row: usize, col: usize, ) -> Result<Option<CellStyle>>

Source

pub fn set_table_style( &mut self, table_name: &str, style_name: &str, ) -> Result<()>

Source

pub fn get_table_style(&self, table_name: &str) -> Result<Option<String>>

Source

pub fn set_cell( &mut self, sheet_idx: usize, row: usize, col: usize, value: String, )

Source

pub fn set_cell_with_type( &mut self, sheet_idx: usize, row: usize, col: usize, value: String, cell_type: CellType, )

Source

pub fn set_cell_type( &mut self, sheet_idx: usize, row: usize, col: usize, cell_type: CellType, )

Source

pub fn get_cell_type( &self, sheet_idx: usize, row: usize, col: usize, ) -> CellType

Source

pub fn insert_row(&mut self, sheet_idx: usize, row_idx: usize) -> Result<()>

Source

pub fn delete_row(&mut self, sheet_idx: usize, row_idx: usize) -> Result<()>

Source

pub fn insert_col(&mut self, sheet_idx: usize, col_idx: usize) -> Result<()>

Source

pub fn delete_col(&mut self, sheet_idx: usize, col_idx: usize) -> Result<()>

Source

pub fn insert_cells_shift_down( &mut self, sheet_idx: usize, row: usize, first_col: usize, last_col: usize, count: usize, ) -> Result<()>

Source

pub fn delete_cells_shift_up( &mut self, sheet_idx: usize, row: usize, first_col: usize, last_col: usize, count: usize, ) -> Result<()>

Source

pub fn add_sheet(&mut self, name: &str) -> Result<()>

Source

pub fn delete_sheet(&mut self, name: &str) -> Result<()>

Source

pub fn rename_sheet(&mut self, old_name: &str, new_name: &str) -> Result<()>

Source

pub fn add_chart( &mut self, sheet_name: &str, chart_type: ChartType, range: String, title: Option<String>, anchor: Option<(usize, usize)>, ) -> Result<u64>

Source

pub fn edit_chart( &mut self, id: u64, name: Option<String>, chart_type: Option<ChartType>, data_range: Option<String>, title: Option<Option<String>>, xlabel: Option<Option<String>>, ylabel: Option<Option<String>>, show_legend: Option<bool>, anchor: Option<(usize, usize)>, ) -> Result<()>

Source

pub fn has_vba_project(&self) -> bool

Source

pub fn list_vba_modules(&self) -> Vec<&VbaModule>

Source

pub fn ensure_vba_project(&mut self) -> Result<()>

Source

pub fn add_vba_module( &mut self, name: String, kind: VbaModuleKind, source: String, bound_sheet_id: Option<u64>, ) -> Result<()>

Source

pub fn remove_vba_module(&mut self, name: &str) -> Result<()>

Source

pub fn rename_vba_module( &mut self, old_name: &str, new_name: &str, ) -> Result<()>

Source

pub fn set_vba_module_source( &mut self, name: &str, source: String, ) -> Result<()>

Source

pub fn delete_chart(&mut self, id: u64) -> Result<()>

Source

pub fn find_table(&self, name: &str) -> Option<(&Sheet, &ExcelTable)>

Source

pub fn list_tables(&self) -> Vec<(&str, &ExcelTable)>

Source

pub fn add_table( &mut self, sheet_name: Option<&str>, name: &str, start_row: usize, start_col: usize, end_row: usize, end_col: usize, has_header_row: bool, has_totals_row: bool, ) -> Result<u64>

Source

pub fn delete_table(&mut self, name: &str) -> Result<()>

Source

pub fn rename_table(&mut self, old_name: &str, new_name: &str) -> Result<()>

Source

pub fn resize_table( &mut self, name: &str, new_end_row: usize, new_end_col: usize, ) -> Result<()>

Source

pub fn rename_table_column( &mut self, table_name: &str, col_index: usize, new_name: &str, ) -> Result<()>

Source

pub fn find_pivot_table(&self, name: &str) -> Option<&PivotTable>

Source

pub fn list_pivot_tables(&self) -> &[PivotTable]

Source

pub fn add_pivot_table_from_table( &mut self, name: &str, source_table_name: &str, dest_sheet_name: Option<&str>, dest_row: usize, dest_col: usize, grand_totals_row: bool, grand_totals_col: bool, ) -> Result<u64>

Source

pub fn add_pivot_table_from_range( &mut self, name: &str, source_sheet_name: Option<&str>, start_row: usize, start_col: usize, end_row: usize, end_col: usize, dest_sheet_name: Option<&str>, dest_row: usize, dest_col: usize, grand_totals_row: bool, grand_totals_col: bool, ) -> Result<u64>

Source

pub fn delete_pivot_table(&mut self, name: &str) -> Result<()>

Source

pub fn rename_pivot_table( &mut self, old_name: &str, new_name: &str, ) -> Result<()>

Source

pub fn add_pivot_field( &mut self, pivot_name: &str, area: PivotArea, column: &str, aggregation: Option<PivotAggregation>, ) -> Result<()>

Source

pub fn remove_pivot_field( &mut self, pivot_name: &str, area: PivotArea, column: &str, ) -> Result<()>

Source

pub fn set_pivot_filter( &mut self, pivot_name: &str, column: &str, values: Option<Vec<String>>, ) -> Result<()>

Source

pub fn refresh_pivot_table(&mut self, pivot_name: &str) -> Result<()>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V