Macro is not working on previous version of Solidworks

Hi,
I was using a macro written by Lenny Kikstra. Here is the link of the page by Lenny Kikstra.

http://www.lennyworks.com/solidworks/default.asp?ID=20

Name of the Macro- DocExport

I made some modifications on the macro as my requirements.  Both of those macro (Main file from Lenny Kikstra and my modified one) were working fine in Solidworks 2016 version. I have attached both of the macro in the attachments.

But whenever I updated my Solidworks from 2016 to 2018, none of those macro works well in SW-2016 version. Then I understand that those macro works only the latest version in my PC. Well, then I again install SW-2017 version in my PC. Again, the problem. It does not work on SW-2018 version that time. As I installed last time SW-2017 version, it works in only SW-2017 version.

Can you please help me where is the problem? I need those macros to be work in all version of Solidworks installed in my PC.

Kindly help me to get a better solution on this issue. As I am not good in macro, I am waiting for your help.

There is some screen shot of the error in the attachments for your better understanding what is happening in my PC when I run that macro.

This is also happening with another macro to rename the drawing sheet. I did not check any other macro in all version of Solidworks.

With best regards

Sobug

SolidworksApi macros