Auto drawing from part file by using macro

Hi friends,

Here I like to create a macro to help me to create drawings from part automation with standard template (customized template) and with empty template.

I grab some macro's from forum and put together for my need, but still I'm facing an error on macro someone can help me in this forum.

Here with attached macro it will helpful to find out the mistake.

Regards,

Kishore

SolidworksApi macros