All templates
Excel AutomationBeginner
Launch Excel and Extract Table
Robomotion•Updated 6 months ago

Overview
Opens an Excel workbook and reads its first table into a structured message variable. Ideal starting point for data-driven flows.
Launch Excel and Extract Table
The most common way to store structured data into Excel is using tables. Robomotion enables you to retrieve data from whole tables or select specific rows and columns.
What Launch Excel and Extract Table can do
Download Fixturessubflow thenBuild Default Path(Core.Programming.Function) setsmsg.default_excel_path = $Home$/templates/excel-automation/launch-excel-and-extract-table/fixtures/sample.xlsxand initialisesmsg.retry_count = 0.Core.Dialog.InputBoxtitledLaunch Excel and extract tablepromptsSelect the excel file to extract table from...→msg.selected_file.Validate(Core.Programming.Function,outputs: 2) — requiresmsg.selected_fileto match/\.xl\w*$/i; otherwise falls through toCore.Flow.Stop.Robomotion.MicrosoftExcel.OpenExcelopens the file withoptVisible: true→msg.excel_app_id, thenRobomotion.MicrosoftExcel.GetRangewithoptRange: 'All-Range'andoptHeaders: falsereads the used range →msg.excel_table, followed byRobomotion.MicrosoftExcel.CloseExcel.Stringify Table(Core.Programming.Function) joins each row with\tand rows with\nintomsg.excel_text, thenCore.Dialog.MessageBoxtitledExcel table values extracted:shows the result.Core.Trigger.CatcharoundOpen Excel— incrementsmsg.retry_count, sleeps 2s,Core.Flow.GoToback to theRetry Pointlabel; after one retry it stops withfailed.
Behind the scenes
optRange: 'All-Range'asks the Excel node for the entire used range in one call, so there is no need to compute free row/column bounds manually.Stringify Tablenormalises both array-of-arrays and array-of-objects shapes before rendering, so the dialog copes with either header or no-header extractions.- The single-retry pattern (
Core.Trigger.Catch+Core.Flow.Label+Core.Flow.GoTo) handles transient Excel COM startup failures while still bounding the retry cost. Close Excelruns before the dialog, so the dialog never blocks the Excel process during display.