Has anyone tried out an example 'Set New End Condition for Simple Hole Feature Example (VBA)'

I am getting a runtime error 13 for type mismatch at this statement

'Set SimpleHoleFeature_DEF = SimpleHoleFeature.GetDefinition'

I am trying to create a macro to determine the number of through holes on a square tube. So any help on that front is also appreciated.

SolidworksApi macros