Excel Application (Hidden Instance)
xl_appRun Excel workbook operations—recalculation, pivots, PDF/PNG export, conversion, encryption, autofit, goal seek, and sparklines—in a private Excel instance.
Instructions
Needs Microsoft Excel on Windows: full recalculation, real pivot tables, PDF export, sheet render to PNG, format conversion, password encryption, exact autofit, goal seek, sparklines and the opens-clean check. Reads go through xl_read, and cell, format and structure edits through xl_edit, xl_format and xl_structure. Ops that change the workbook back it up first. These ops run in a private hidden Excel that this server starts and closes. They never attach to or change the user's own Excel, and a workbook the user has open in Excel is refused, not edited. Ops, one per line, as name(required; opt optional): what it does. path, backup and verify_com are not repeated; xl_help shows them:
recalculate(opt engine timeout_seconds allow_network): Recalculate every formula in a hidden Excel and save the results; a circular reference is named.
com_manage_pivot(action; opt name source_sheet source_range dest_sheet dest_cell rows columns filters values timeout_seconds allow_network): Create, refresh, delete or list real pivot tables through Excel.
com_export_pdf(output; opt scope sheet range_a1 overwrite timeout_seconds allow_network): Export to PDF via Excel's real renderer.
com_render_sheet(output; opt sheet range_a1 overwrite timeout_seconds allow_network): Render a sheet or range to a PNG exactly as Excel shows it; the workbook is not changed.
com_convert_format(output; opt format overwrite timeout_seconds allow_network): Convert the workbook to xlsx, xlsm, xlsb, xls, csv or ods with Excel's own Save As; the source is never overwritten.
com_save_with_password(password; opt current_password timeout_seconds allow_network): Encrypt the workbook with Excel's real password encryption; the password cannot be recovered, so keep the backup.
com_autofit(opt sheet columns rows timeout_seconds allow_network): True column and row autofit using Excel's real text metrics (the file tier can only estimate widths). More ops follow, in the same format, in the op parameter's description.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | Yes | The operation to run: an op listed in this tool's description, or one of these, in the same format: - com_goal_seek(target_cell, target_value, changing_cell; opt sheet save timeout_seconds allow_network): Excel's Goal Seek: adjust changing_cell until the formula in target_cell reaches target_value. - com_set_sparkline(opt action location source type sheet timeout_seconds allow_network): Create, clear, or list sparkline groups through Excel. - com_validate_opens_clean(opt password timeout_seconds allow_network): Open the file in a hidden Excel and report whether it opens without a repair prompt. - update_now(): Install the newer version the update notice named; call only when the user asks or agrees. - update_notices(action): Turn update notices on or off, or show their status (action). | |
| args | No | The op's arguments as an object. Include path (the workbook file) unless the op's line names other paths or the op reads no workbook; unknown keys are refused. xl_help lists every argument. |