Skip to main content

AI Document Editing with Code Execution

Keep track of the version being edited

Start with one clear edit and identify the input file. Open and review the returned file, then use that version for the next edit.

When an outcome is uncertain, inspect it before rerunning. Code may have completed work even if its response was interrupted.

AI Document Editing with Code Execution

Hatz can use Code Execution to create, edit, analyze, and transform documents, presentations, spreadsheets, PDFs, charts, and other files directly from chat, apps, or workflows.

When you upload document files, Hatz should bind Code Execution automatically for document work. For broader file-generation requests, turn on Auto-Tool so Hatz can select the tools needed for the task, including Code Execution when it needs to create or edit a real file.

Editing older uploads: Documents uploaded before this feature was enabled may not be editable. This includes files in existing chats and constants referenced in Agents, Apps, and Workflows. If the error confirms that the input is unavailable, first check what earlier edits completed. Reattach the intended version only when needed for the remaining work; do not replay an uncertain edit.

Quick start

  1. Turn on Auto-Tool.

  2. Upload the document, spreadsheet, PDF, or presentation you want Hatz to work with.

  3. Tell Hatz exactly what to change, analyze, or produce.

  4. Ask for the result as a downloadable generated file.

  5. Download the result from the Generated file card.

Example: Use Code Execution on this spreadsheet. Add a summary sheet, save the result as client_summary.xlsx, and return it as a downloadable file.

Supported file types

Hatz accepts more than modern Office files. Upload families include documents and presentations (DOC, DOCX, PDF, PPT, PPTX), spreadsheets/data (CSV, XLS, XLSX, XLSM, XLSB, TSV, JSONL), images, audio/video, text/code/configuration, ZIP archives and specialist inputs such as PCAP, PCAPNG, EVTX and MPP. See Supported File Types for the current list.

Editing support varies by format. Specialist binary inputs can be available to code as original files even when they have no searchable extracted text. Choose an output format suited to the result you need.

Legacy Office formats such as .doc, .xls, and .ppt are accepted uploads. Converting a copy to a modern format can help with an edit that the original format cannot support. Macro-enabled files are not supported for macro execution.

What Hatz can do

  • Word documents: replace text, update formatting, add generated content, summarize, extract tables, and create new .docx files.

  • Spreadsheets: clean data, remove duplicates, merge files, calculate summaries, create charts, recalculate formulas when requested, and export .xlsx or .csv files.

  • PowerPoint: update text, reorder slides, duplicate slides, merge decks, generate slides from structured data, and create updated .pptx files.

  • PDFs: extract text, merge or split pages, rotate pages, fill forms, add overlays, and convert content into editable formats when possible.

Files, downloads, and persistence

  • Your original upload is not overwritten. Hatz creates a new output file.

  • Successful outputs appear as Generated file cards with a download button.

  • Download useful results while they are available. If a result is missing, check the original chat and tool output before deciding whether it needs to be generated again.

  • Some organizations restrict direct downloads. If direct downloads are not available, you may need to use Microsoft 365 export or contact your Hatz administrator.

If Hatz returns a sandbox path

A path such as /home/daytona/workspace/output/updated_deck.pptx points to the execution workspace. Ask Hatz to find the existing output at that exact path and return a downloadable file.

  • Ask Hatz to create a downloadable generated file for that exact path.

  • Ask for the existing output to be returned as a downloadable file first. Do not rerun the edit until you know what completed.

  • In workflows, check the run output and the relevant step output for a generated file card.

Hatz cannot save directly to a local Windows or Mac path such as C:\Users\name\Downloads\report.xlsx. Ask for a generated file card, then download it or save it through an available Microsoft 365 option if your organization requires Microsoft export.

Best practices

  • Be specific about the file, page, slide, sheet, column, or section to update.

  • Tell Hatz what formatting or structure to preserve.

  • Specify the desired output file name and format.

  • For multi-step editing, refer to the new file Hatz just created. Example: Now filter the data in the new file you just created.

  • For many outputs, ask Hatz to place everything in one zip file.

Limitations

  • Execution limits depend on the operation and surface. Use the actual timeout or failure message to choose a smaller follow-up; do not treat one time limit as the duration of every chat or workflow run.

  • Password-protected or encrypted files must be unlocked before uploading.

  • Scanned PDFs depend on OCR quality and may need manual review.

  • PDF-to-Word conversion is not always pixel-perfect, especially for complex layouts.

  • PowerPoint edits can preserve structure, but very long replacement text may overflow existing slide shapes.

  • Formula recalculation should be requested explicitly.

  • Interactive Excel objects such as pivot tables may be returned as static calculated outputs rather than live Excel objects.

Example prompts

  • Replace all instances of Acme Corp with Hatz AI. Keep headings and table formatting unchanged. Return the updated .docx file.

  • Analyze this CSV, calculate month-over-month growth, create a bar chart for the top 5 regions, and return an Excel file plus a PDF summary.

  • Update this deck with the attached notes, shorten each title to under 7 words, and return the updated .pptx file.

  • Merge these PDFs, rotate pages 3 through 5 to portrait, and return the merged PDF.

  • Use Code Execution to generate the final report as a PDF. Return report.pdf as a downloadable generated file, not just a file path.

Troubleshooting

  • If code execution times out, inspect completed work and saved outputs. Only retry a smaller part once you know it did not complete and it is safe to repeat.

  • If no generated file appears, open the tool result and check for an execution or save error. Ask for any existing output to be returned before repeating the edit.

  • If Hatz returns a sandbox path, ask it to create a downloadable generated file for that path.

  • If generated files could not be saved, preserve available outputs and follow the file-count-limit guide.

  • If a download fails, see Can't Access File Generated In Chat.

  • If a generated Word document opens as corrupted, prompts Word to repair it, or its links and cross-references are broken, ask Hatz to regenerate the file. If it still fails, request a simpler output so you can isolate the cause, for example the same content as a plain .docx without embedded links or as plain text. Broken links usually mean a reference could not be resolved while the file was being built, not that the file itself is damaged.

  • If Hatz returns an image or screenshot of the source document instead of its extracted text or data, the file is probably being read as an image, for example a scanned PDF, an exported picture, or an image-only page. Ask Hatz to extract the text or run OCR, or provide a text-based version of the file. For image-heavy sources used by an Agent, summarize the content into text first and use that text as the source.

  • If the code step stalls or describes the wrong file, stop and compare the named input and latest saved output. Keep the original. For uncertain execution, do not repeat the edit; ask Support to establish what completed. If a new chat is appropriate, attach only the verified version needed for the remaining work.

Chat Files panel containing the generated Cedar workbook and HTML preview.

Watch: upload, edit and download a file

Download a Word copy with tracked edits

When you want to review a change before accepting it, attach the original DOCX and ask Chat to return a separate copy with Track Changes pending. Open the downloaded copy in an editor that displays revisions to check the deletion and insertion.

Did this answer your question?