# Run an Excel VBA workflow and verify what it changed A native VBA experiment on Panes refreshes a query, checks 480 documents and reconciles $686,500 without changing Office trust settings. Includes the macro and workbook. Published 2026-11-15T07:30:00Z by Renaissance Superintelligence Corporation (RSI). Use an approved macro-enabled workbook, invoke the intended macro explicitly and verify its outputs. Our prepared Panes test created an .xlsm research copy, ran a query-refresh and reconciliation macro, and saved a receipt for 480 clean documents and $686,500. Office trust settings were unchanged. ## The macro had a narrow job The starting expense workbook already contained the synthetic source table, Power Query and report formulas. We saved a separate .xlsm copy, inserted a reviewed research module and called that module through Excel’s Application.Run. No macro-security setting or account configuration was changed. The macro refreshed the Actuals query synchronously, rebuilt calculation, checked for 480 clean documents and compared Report!C9 with $686,500 using a half-cent tolerance. Only after those checks did it write a success receipt into Read me!A14 and save the workbook. This demonstrates native VBA execution in the tested environment. It does not demonstrate running arbitrary downloaded macros, bypassing Trust Center or deploying an unsigned macro under a customer’s policy. Treat approved code and the environment’s permission to run it as explicit inputs to the task. ## Name the workbook and module Microsoft documents Application.Run as the method for running a macro or function. Our invocation includes the workbook filename and PanesResearch.RefreshAndReconcile so it targets the intended copy. The test captures the resulting receipt rather than relying solely on the controller command completing. The full published script includes the macro source. Review that source before executing the downloadable workbook. A production workflow should use its organization’s approved macro distribution and trust policy; this experiment does not choose that policy for you. The code raises errors when its financial assertions fail. Microsoft also documents that an unhandled error inside a called macro can display a runtime dialog and stop unattended execution. Our observed run passed. Do not treat this happy-path fixture as a tested failure-reporting framework; add and test a bounded error-return contract before adapting it to unattended production use. ```powershell $macro = "'" + $wb.Name + "'!PanesResearch.RefreshAndReconcile" $xl.Run($macro) $receipt = $wb.Worksheets.Item('Read me').Range('A14').Value2 if ($receipt -ne 'VBA research check passed: 480 documents / USD 686500') { throw 'Expected macro receipt is missing' } ``` ## A receipt records a checked stage The saved receipt is useful because the macro writes it after its two assertions. It is not an independent audit of every report cell. The query could still need additional tests for date boundaries, duplicate conflicts, mapping completeness or downstream pivots. For this research fixture, the receipt establishes the tested document count and report total. Keep the source file, macro source and result log together. That lets a reviewer distinguish what the code checked from what a later narrative claims. The test also required programmatic access to the VBA project because it created its own module. Running an already approved macro and generating new VBA code are different operations. If your organization permits the former and blocks the latter, use its approved workbook rather than weakening that policy. ## Use a fresh research copy Download the [macro-enabled output](/research/native-office-2026-11-15/vba-refresh.xlsm), [exact result](/research/native-office-2026-11-15/vba.json) and [script including VBA source](/research/native-office-2026-11-15/native-vba.ps1). The script expects the synthetic [expense workbook](/examples/excel-to-powerpoint/October%20close.xlsx) named expense-original.xlsx in a new task directory. Use [Panes desktop execution](/docs#commands) and keep the native Office window available for review. If execution is blocked or a dialog appears, report that state and inspect it. The result should never be described as passed merely because the controller stopped waiting. For broader acceptance, apply the [workbook verification checks](/blog/verify-ai-generated-excel-workbooks) and the [query-to-pivot dependency test](/blog/refresh-pivot-after-power-query). A successful VBA call is one stage in a checked Office workflow. ## Evidence Prepared scripted execution on one retained 4-vCPU, 16-GB Windows research computer, November 15, 2026. Excel 16.0 build 20527. The macro call took 1.933 seconds. The native script, including its cleanup, took 5.003 seconds; API time was 8.058 seconds and controller wall time 8.137 seconds. The existing research environment allowed VBA and VBA project access. That is a precondition, not evidence of compatibility with every enterprise Office policy. One observed run, not an autonomous-agent or fleet benchmark. Per-task operating cost is unmeasured. Public Office copies have author metadata redacted; all other ZIP members are identical to the native outputs. They were reopened read-only in Office without changing their bytes. ## Sources - [Microsoft: Application.Run, including macro error behavior](https://learn.microsoft.com/en-us/office/vba/api/excel.application.run) - [Microsoft: Office solution security notes](https://learn.microsoft.com/en-us/office/vba/library-reference/concepts/security-notes-for-microsoft-office-solution-developers) - [Exact native VBA result](https://usepanes.com/research/native-office-2026-11-15/vba.json) - [Public-file identity and native reopen](https://usepanes.com/research/native-office-2026-11-15/publication-manifest.json)