MS Excel

Top  Previous  Next

We will show how to use the client from Excel. This is a sample Excel spreadsheet with fields for choosing from- and to coordinates for which we would like to find the fastest route and display its distance and time:

 

 

Open the spreadsheet and "enable" macros. Press F9 and then click the button and you will see the results being calculated.

 

Behind the scenes

 

Before being able to create the macro, we need to tell VBA to use kbmMWComClient (our OCX):

 

Go into Tools > VB Editor and then again Tools > Reference.

 

 

In it, find the entry 'kbmMWComClient library'. If its not there, you have forgotten to install the OCX properly. Make sure to put a checkmark on the entry and click the 'OK' button to confirm. Now VBA know about the OCX and know that we want to use it for use in a sample VBA macro.

 

Please refer to the spreadsheet in the ocx/sample folder for details of the macro code. There are many comments included.