Macro to create Property Manager fails on 64bit

I have a macro that creates a Property Manager page. Its copied from the API help and tweaked. It runs fine on a 32bit operating system but 64bit gives an error 98. Not sure if this is a bug in the API or what. The sample in the API fails twoo.

SolidworksApi macros