New sales missing from the dashboard?
One refresh adds £960.54: £132,141.82 → £133,102.36. Refunds are deducted; refreshing again keeps the same total.
Staff: add sales → click Refresh sales → check Audit → save. Download the button workbook · See the button run.
Case 04 of 8 in Excel & VBA casebook
What was wrong
New orders were in the sales list but missing from the dashboard. Refunds needed taking off, while unpaid and cancelled orders needed keeping out of paid sales. Repeated order numbers and incomplete entries needed checking before they could be counted.
What changed
The refresh rebuilds the total, monthly breakdown and category breakdown from the sales list. It includes the new January sales and Repairs category, keeps money still owed separate, and lists each rejected entry with a reason. The original sales list stays intact.
1,332 entries = 1,300 accepted + 32 for review. £13,055.32 still owed stays outside paid sales. The row-by-row record explains every decision.
The button in use
The Refresh sales button is already installed in the workbook. The download contains the refreshed result shown above.
Recorded button actions, with the resulting saved workbooks:
| Action | Paid sales | Saved result |
|---|---|---|
| Press with the original sales list | £132,141.82 | Before |
| Add the 12 new entries, then press | £133,102.36 | After |
| Press again | £133,102.36 | Repeat |
Saved-view replay of the recorded button presses; the figures come from the three linked workbooks.
The saved macro workbook was then reopened and its button pressed again; all totals and rows still matched. Full-size summary · Workbook view.
For staff, each refresh is:
- Open the workbook in desktop Excel and enable its macros after reviewing the source. The button is on Dashboard, below the total.
- Add new rows at the bottom of Sales, using the existing columns and keeping the header once.
- Click Refresh sales. Look for “Checked: all source rows accounted for” below the total.
- Check Audit for rejected rows. Correct those entries in Sales, refresh again, then save. Keep personal notes outside the derived tabs.
The supplied workbook already contains the new entries. For a rehearsal from the earlier state, follow the before-state setup and refresh procedure; do not append the sample entries to the finished download.
Files: button workbook · before · after · repeat · sales list · totals and checks.
Developer details: reproduce the results and inspect the checks
Try it yourself
From this folder in the full repository, with Docker running:
./run.sh
Rebuilds the macro workbook from source, activates its installed button for the before, added-sales and repeat checks in LibreOffice, saves fresh results, then reopens the saved macro workbook and activates its button again. It also recalculates the independent Python reference and runs the business tests. A failure returns a nonzero exit code.
All workbooks and run records go to output/. Use ./run.sh --input /path/to/input --output /path/to/results for separate folders. Setup · input format · VBA source and setup.
How it is tested
- LibreOffice Calc 24.2.7.2, headless: the button run activates the imported Forms control through
XAccessibleAction.doAccessibleAction(0). ItsactionPerformedbinding invokes the embeddedModule1.RefreshDashboard. This is an accessibility button press, not a physical mouse click. Each phase starts with cleared derived rows and an invalid total, so a stale workbook cannot pass. - Every source value, accepted row, audit decision, total, breakdown and chart range is compared with the independent Python calculation. Each saved snapshot is read back and checked. The final
.xlsmis saved with its VBA document module names preserved, reopened, and its button retested; module extraction verifies the VBA source survives the save unchanged. - Python and LibreOffice formula recalculation: business tests cover totals, refunds, unpaid/cancelled orders, duplicate IDs, invalid entries, moved headers and repeat runs. Reference runtime records the formula-only calculation separately.
The summary graphic above is typeset from the saved button-run values. Page previews record the local phone and laptop render checks.
£45 fixed, up to 5,000 rows, 3 working days.
More rows or pages: I quote the difference in writing before I start. Contact me through the platform where you found this case.