Excel Open (Session)
Excel Open (Session)
Section titled “Excel Open (Session)”Type: excel-open · Package: Excel Activities v1.0.0 · Output: ZoanExcelSession
Open an Excel workbook and return a session (ZoanExcelSession) that you share with other Excel activities. It is the beginning of session mode, recommended when you are going to do several operations on the same file: opening it once is much faster than opening and closing at each step.
If the file does not exist, it creates it.
How it works
Section titled “How it works”Tienes dos formas de uso:
- With output variable: you save the session in a variable (e.g.
libro), pass it to the activities withsession = = libro, and at the end you close with Excel Close. - With
body: the activities within the sub-flow work on the book and, when finished, it is saved and closed automatically. You don’t need an Excel Close.
Required parameters
Section titled “Required parameters”| Parameter | Editor | Description |
|---|---|---|
path | expression | Path to .xlsx file. It is created if it does not exist. Supports expressions (e.g. = asset("datos.xlsx")). |
Optional parameters
Section titled “Optional parameters”Ninguno.
Subflows (lanes)
Section titled “Subflows (lanes)”body optional
Section titled “body optional”Activities to carry out with this book. If omitted, it returns the session as exit (and you must close it with Excel Close).
Output
Section titled “Output”Returns a ZoanExcelSession. Pass it as session to the other Excel activities.
Example
Section titled “Example”With output variable:
Excel Open path = = asset("reporte.xlsx") → output: libroWrite Excel Sheet session = = libro sheet = "Datos" data = = tablaWrite Excel Cell session = = libro sheet = "Resumen" cell = "B2" value = = totalExcel Close session = = libroRelated activities
Section titled “Related activities”- Excel Close — save and close the session.
- Excel Save — save without closing.
- Read Excel Sheet / Write Excel Sheet — trade with the session.