UmyaSpreadsheet.WorkbookFunctions (umya_spreadsheet_ex v0.7.0)
View SourceFunctions for manipulating workbook properties and security.
Summary
Functions
Sets password protection for an existing Excel file.
Sets workbook protection with a password.
Functions
Sets password protection for an existing Excel file.
This function adds password protection to an existing file without loading it into memory.
Parameters
input_path
- Path to the input Excel fileoutput_path
- Path where the protected file should be savedpassword
- The password to protect the file with
Returns
:ok
on success{:error, reason}
on failure
Examples
:ok = UmyaSpreadsheet.WorkbookFunctions.set_password("input.xlsx", "protected.xlsx", "password123")
Sets workbook protection with a password.
Parameters
spreadsheet
- The spreadsheet structpassword
- The password to protect the workbook with
Returns
:ok
on success{:error, reason}
on failure
Examples
{:ok, spreadsheet} = UmyaSpreadsheet.read_file("input.xlsx")
:ok = UmyaSpreadsheet.WorkbookFunctions.set_workbook_protection(spreadsheet, "password123")