Visual Basic for Applications/Check if a Workbook has VBA code

Summary
This VBA code module is made for Excel, but is easily adapted for other MS Office applications. It checks a workbook to see if it contains any useful VBA dimensional or structural code. Line counting has been found to be less reliable than this since even empty modules will show two lines of code each.

The Code Module

 * Place all of the code below into the same standard module, and identify the test workbook address in wb.
 * Then, run the procedure CheckForVBA to check whether or not the test workbook contains identifiable VBA code structures.
 * The procedures first check to see that the workbook is not locked.
 * Users can modify the test keyword list in procedure ContainsVBAKeyWords.
 * The test workbook is closed again after inspection.
 * Results are shown in message boxes here, but the top section is easily modified for other uses.