Load UserForm1 Error

Hey everyone,

I am trying to modify "PeterEditProp.swp" which I found on one of the threads on this forum.  I have modified it to have different userforms for when a drawing is open or an part/assembly is open.  I had it running fine with drawings and when I tried to run it with a part open I got this error message: Run-Time Error '91': Object variable or With Block variable not set.  And it hangs up on Load UserForm2.

Then when I tried to run it with a drawing open again, I got the same error message and it hung up on Load UserForm1.

I can't seem to find what isn't defined.  Could anyone point me in the right direction?  My code is attached.

Thanks,

Tara

SolidworksApi macros