Solidworks VBA script works in Solidworks but not in EPDM task

I have a script that executes a pack and go, convert drawing to PDF then launches a vbscript to do some filename manipulation and moves the files to our ftp server.  It works perfectly when executed in Solidworks' Macro feature, but when I copy and paste the code into EPDM's task feature, it just fails without a meaningful error. 

I'm using Functions and Sub routines in the script so I don't know if that might have anything to do with it.  Has anyone experienced this problem and if you found a fix or work-around for it? 

Thanks!

SolidworksApi macros