Without seeing the code, my guess is that your “Subscript out of range” issue is due to the array(s) in the program not being DIMensioned with enough elements. Check the loop that is used to update the array(s) and see if the original programmer has included code to count the number of items being processed and has a provision to REDIMension the array(s). (Check the Lotus Script documentation for more information about DIM and REDIM.)
As to not being able to open the file while in debug mode, check the file permissions on the flat file. You may have full admin rights in Notes, but not have access to the flat file. Even though the flat file may be on the Domino server, your network permissions to that file and / or folder may be limited.