Macro to insert BOM suddenly fails..?

Hi All,

For the last couple of years, we have used the attached macro to insert BOMs into our drawings.

Always worked until today. Suddenly we get a runtime 91 error, please see attached.?
What has changed over night?

SolidworksApi macros