Too many files
There is a limit to the number of disk files that can be open at one time. This limit is a function of the "Files=" setting in your CONFIG.SYS file. Increase that number and reboot.
The operating system has a limit to the number of files in the root directory (usually 512). If your program is opening, closing, and/or saving files in the root directory, change your program so it uses a subdirectory.