Query Sage 100 from Excel with Power Query
Pull live Sage 100 customers, open invoices and stock into Excel with Power Query, no ODBC driver or DSN needed, and refresh with one click.
"Query Sage 100 from Excel" is one of the most common Sage searches, and the classic answer is the ODBC driver with Microsoft Query. That still works, but it ties every spreadsheet to a driver, a DSN and the right bitness on each person's PC. Power Query, built into Excel since 2016, can read the same data from a web address instead.
What you need
- Excel for Microsoft 365, 2021, 2019 or 2016 (Power Query is under Data → Get Data).
- An endpoint that returns JSON or CSV. The examples use the Greenbar sandbox and its demo company ABC.
Option A: the From Web dialog (no code)
- Data → Get Data → From Other Sources → From Web.
- Choose Advanced.
- URL parts:
https://api.greenbar.octor.top/v1/companies/ABC/customers?balance_gt=0&format=csv - HTTP request header: name
Authorization, valueBearer sk_test_demo. - Click OK, then Load. Excel creates a table of every customer with an open balance.
To refresh, click Data → Refresh All. To refresh on open, right-click the query, choose Properties, and tick "Refresh data when opening the file".
Option B: paste a query (more control)
Data → Get Data → From Other Sources → Blank Query, then Advanced Editor:
let
Source = Json.Document(Web.Contents("https://api.greenbar.octor.top",
[RelativePath = "v1/companies/ABC/invoices/open",
Query = [limit = "100"],
Headers = [Authorization = "Bearer sk_test_demo"]])),
Invoices = Table.FromRecords(Source[data]),
Typed = Table.TransformColumnTypes(Invoices, {
{"invoice_date", type date}, {"due_date", type date},
{"balance", Currency.Type}, {"days_overdue", Int64.Type}}),
Sorted = Table.Sort(Typed, {{"days_overdue", Order.Descending}})
in
SortedUseful sheets to build
| Sheet | Endpoint | What finance does with it |
|---|---|---|
| Open AR by customer | /customers?balance_gt=0 | Credit review, pivot by salesperson |
| Overdue invoices | /invoices/open?overdue_days_gt=30 | Collections call list |
| Aging summary | /ar-aging | Weekly AR report |
| Low stock | /items?below_reorder=true | Purchasing list |
| Open orders | /sales-orders?status=open | Backlog review |
Raw Sage field names
Accountants who know Sage reports may prefer the original field names. Add fields=raw and columns come back as ARDivisionNo, CustomerNo, CustomerName, CurrentBalance, matching what they see in Sage and in Crystal Reports.
Compared with Microsoft Query and ODBC
| Microsoft Query + ODBC | Power Query + web source | |
|---|---|---|
| Setup per PC | Driver, DSN, matching bitness | None |
| Works on a Mac | No | Yes, in recent Excel for Mac builds |
| Works outside the office network | Only with VPN | Yes |
| Write SQL | Yes | No, filter with URL parameters |
Things to watch
- Keep keys out of shared workbooks. A real API key in a spreadsheet emailed around is a leaked key. Use per-user keys or a read-only key scoped to reporting.
- Privacy levels. If Excel asks about privacy levels when combining sources, set the API source to Organizational.
- Large tables. Endpoints page at 100 rows. For more, follow
next_cursorin Power Query or ask for a CSV export endpoint built for bulk.
Next: Power BI without the ODBC driver.
curl "https://api.greenbar.octor.top/v1/companies/ABC/customers?balance_gt=0&format=csv" \ -H "Authorization: Bearer sk_test_demo"
A REST API for Sage 100, self-serve
One HTTPS endpoint and a typed SDK instead of BOI scripts and ODBC DSNs on every customer's server. Read access is free during the beta.
Join the waitlist