- Demonstrate openFDA API usage within the VBA framework
- Create a replica of the FDA's NDC Directory
- Microsoft Excel 2010+ (OS must be able to support Regular Expression, Dictionary, and XMLHTTP objects)
- Note: I have also translated this repository to Javascript for Google Sheets
- The openFDA API is called with the XMLHTTP object
- The XMLHTTP object returns a JSON script
- The JSON script is parsed using code found here
- The parsed JSON script is reformatted and written to a dictionary object
- Steps 1-4 are repeated until all data is retrieved
- The dictionary object is copied to an array to write to an Excel worksheet
Download 'NDC Directory.xlsm'
The current file has two main subs:
Sub openSearchForm()
Opens the userform for the NDC directorySub resetSheet()
Resets the formatting and clears the active sheet
Note: The search field(s) do not support partial spelling