/VBA.CurrencyCode

Retrieve and maintain ISO 4217 currency codes

Primary LanguageVBAMIT LicenseMIT

VBA.CurrencyCode

Help

ISO 4217 Currency Codes

Currency codes can be obtained from many sources.

The modules here retrieve them from two sources:

  • ISO itself. The definitive source
  • Currency Converter API

ISO - the definitive source

ISO is the organisation that maintains the official list of currency codes, known as the ISO 4217 standard:

Currency codes - ISO 4217

Contrary to most of the standards maintained by ISO, the list of currency codes is free to download as an XML file, and this is what the code does. However, as the list is only rarely updated, before a download is attempted, the publishing date is checked - and only if it is newer than the date of the last download, the list is downloaded.

The publishing date is stored as a property of the database.

The update function will maintain a table with the weird name of CcyNtry (from the XML file). Thus a query, Iso4217CurrencyCode, is included which returns a sanitised list of the currency codes with meaningful field names:

Help

Currency Converter API

While the official ISO 4217 list is, per definition, complete, it also contains several rarely used currencies for which you may not even be able to obtain a daily exchange rate.

For this reason, another method is offered, which retrieves the currency code list offered and published by Manuel Vergel:

Currency Converter API

This is Json data fetched as an array and used to maintain the table CurrencyCode. Again, a query is available, CcaCurrencyCode to return the essential data.

The structure of the table allows for storing historical (obsolete) currency codes.

Code

Code has been tested with both 32-bit and 64-bit Microsoft Access 2016 and 365.

It requires the Json modules from project VBA.CVRAPI.

Documentation

Full documentation can be found here:

EE Logo

ISO 4217 Currency Codes in VBA

Included is a Microsoft Access example application.

Currency Exchange Rates

For this, see my project VBA.CurrencyExchange.


If you wish to support my work or need extended support or advice, feel free to: