Docs

RunMacro Documentation

Create your first robot, then go further as needed.

Clear step-by-step guides to create, run, and improve robots for repetitive computer work.

Docs File Smart Export Table
📊 File

Extract Desktop UI Tables to Excel & CSV (Smart Export Table) in RunMacro

Smart Export Table extracts tabular data (DataGrids, Tables, ListViews) from desktop apps into Excel, CSV, or memory variables via Windows UI Automation, even if the app lacks an export feature.

Prerequisites#

  • The target desktop application displaying a table is running.
  • The grid control is targeted using the Pick Table button.

Supported modes#

  • Desktop Mode — Reads structured rows and columns via UIA TablePattern and GridPattern.

What it does#

The Smart Export Table command automatically extracts rows and columns from desktop Table, DataGrid, ListView, or TreeView controls using Windows UIA TablePattern and GridPattern. Extracted data includes column headers and cell values, and can be saved directly as an Excel workbook (.xlsx), UTF-8 encoded .csv file, or stored in a memory variable for workflow iteration (Loop).

Screenshots & video#

RunMacro Smart Export Table command configuration dialog showing parameter fields
Configuration dialog and parameter fields for the Smart Export Table command in RunMacro.

When to use it#

  • Extracting inventory reports and invoice lists from legacy desktop software that lack an export button.
  • Extracting banking transaction statements, payroll sheets, or reconciliation grids into external files.
  • Loading table data into a JSON workflow variable to iterate through rows and automate subsequent actions.
  • Scheduling recurring automated backups of desktop management grids into standardized CSV archives.

When not to use it#

  • Scraping tables from web browsers (use Smart HTML Table extraction instead).
  • Scanned raster table images (use Scan OCR instead).

Configuration steps#

  1. In RunMacro, select the File › Smart Export Table command.
  2. Click 🎯 Pick Table/DataGrid and left-click the target table in your desktop app.
  3. Select destination under Save to: variable, excel, csv, or txt.
  4. If exporting to file, provide the destination path in File path (e.g. C:\Reports\Invoices.xlsx).
  5. Check Has headers if the first row contains column headers.
  6. Set Max rows (enter 0 for unlimited extraction).
  7. Click Save to insert the command into your workflow.

Every option explained#

🎯 Pick Table/DataGrid#

Target picker overlay to extract UIA Automation ID, Control Type, and Window properties of the target table.

Save to#

Target storage: variable (stores structured array in variable), excel (creates .xlsx), csv (creates .csv), or txt (tab-delimited file).

Variable Name#

Variable identifier when Save to is set to variable (default table_data), accessible downstream via {table_data}.

File Path#

Absolute path to output file (supports dynamic variables such as C:\Data\export_{date}.xlsx).

Has headers#

Treats the top row as column headers to format CSV/Excel columns and JSON object dictionary keys.

Max rows#

Caps total rows to scrape. Enter 0 to scrape all available table rows without limits.

Expected result#

An Excel (.xlsx) or CSV file is generated with populated rows and columns, or a variable is assigned the table array.

Real example#

Example: Export 200 sales orders from POS app to Excel#

  1. Add a Smart Export Table command.
  2. Pick the orders DataGrid in the POS desktop application.
  3. Set Save to: Excel and path to D:\Orders\TodayOrders.xlsx.
  4. Set Max rows to 200 and enable Has headers.
  5. Execute — all 200 orders are written into an Excel spreadsheet in seconds.

Limitations and failure cases#

  • Custom canvas-drawn grids without UIA support require OCR region scanning.
  • Extremely large tables with millions of rows should specify Max Rows to conserve memory.

Tips & common mistakes#

When saving to a variable, pair it with a For Each Row loop to iterate through every record programmatically.
For UI Virtualized tables that only render on-screen rows, combine with Smart Scroll to load all records prior to extraction.

Verification details#

  • commands/smart_desktop_scrape_table.py · verified 2026-09-30
RunMacro robot

Robots do the work. Your time is yours.

Create a robot in minutes, no coding needed. Reliable execution, remote management, transparent costs — and you always stay in control.