Pulling JSON from APIs into Excel with VBA

Discussion

Has anyone tried this in VBA? Say an API returns the object below, I would want:

  1. Table columns:
    • [ id ]
    • [ customer.name.first ]
    • [ customer.name.last ]
    • [ customer.city ]
    • [ items ] --> [ array of objects as json string ]
  2. Loop through items column, for each nested object, 2nd table clear, then append rows:
    • [ parentId ]
    • [ sku ]
    • [ qty ]
    • [ price ]

​

{
  "orders": [
    {
      "id": "ORD-001",
      "customer": {
        "name": {
          "first": "Alice",
          "last": "Johnson"
        },
        "city": "Seattle"
      },
      "items": [
        {
          "sku": "TSHIRT-BLK",
          "qty": 2,
          "price": 19.99
        },
        {
          "sku": "JEANS-BLU",
          "qty": 1,
          "price": 59.99
        }
      ]
    },
    {
      "id": "ORD-002",
      "customer": {
        "name": {
          "first": "Bob",
          "last": "Smith"
        },
        "city": "Austin"
      },
      "items": [
        {
          "sku": "LAPTOP-X1",
          "qty": 1,
          "price": 1299
        }
      ]
    }
  ]
}

Posted Mar 6, 2026, 8:52 PM UTC · locked

11
Loading comments…