Waste Management in Excel with added API

Tom Passmore

Friday, 12 July 2019


Waste Management Company Excel Logo APIs in the Cloud Banner

Alot of waste companies use Microsoft Excel to help them with their waste management duties.  Excel is a fantastic tool.  It isn't a tool that can do everything, do it can do alot! I love excel.  And when I worked for a waste management company it was the most verstatile tool at my disposal.  And that was before I learned about Visual Basic For Applications (VBA) and well before I learnt about Application Programming Interfaces (APIs). Put those together with Dsposal's Waste Thesaurus and you have one very powerful tool to help you classify waste.

In this article you will learn about how to get an API key, how to download some example code for VBA and how to use that VBA to interact with Dsposal's API.  This is just a very simple, relatively easy example of how to use the API to help you with your tasks. There are many more.

Before You Start

Before we begin with classifying waste in Excel using the API, you will need:

Where to get you API Key From

Navigate to the Developer Tab

  • Click Generate API Key
  • Your Key will be generated according to the following format API_XXXX-XXXX-XXXX-XXXX
  • By Creating an API Key, will be automatically subscribed to the Free API Plan which grants you 500 free API Calls per month. You can scale up or out between plan at any given time

Where to Download the Example Excel File

The example file can be downloaded by clicking the button below.

Where to start

Open the excel file.

When the file loads there will be a Security Warning stating that the macros have been disabled.  You will need to enable the content to get the file to work. The file is not password protected and you can investigate the VBA code.

The file contains 5 search terms.  When the code runs the file will talk to Dsposal and populate the two blank columns.  In the first column (called "Returned EWC Code (Top 5)"), upto 5 EWC Codes will be returned. In the second empty column (called "Returned Entry Type (Top 1)") the EWC Code description for the most accurate ewc code will be returned.

To get this to work you need to:

  • Press "Get EWC Codes"
  • Enter your email address email
  • Enter You API Key
  • Press Run

Waste Management Excel File Example with Dsposal API GIF

Where to go from here

You can now add additional items into the table and run the code again, and again, and again. Like we mentioned you get 500 calls a month for free.

Please note that the VBA code is written to get a simple result and is not built to provide a business solution. The code requires access to open-source software written by Tim Hall. Their code was based on work by Ryo Yokoyama. This module is called JsonConverter.

Understanding this you can now go and build ontop of these modules to provide you the tools for your work. To find out more we have created the API Documentation to help you understand the building blocks.


Category: Dsposal

Find the right place for your waste


Using Dsposal means you know the waste company is licensed. By only using licensed waste companies you help tackle the causes of waste crime.

Find a Waste Operations Company