Good news! The 32767 files limit was caused by a list box. There's no way to store more than 32767 entries in a list box so I thought it would need a huge rewrite but I was wrong.
I've removed the list box and replaced it with a self-written class which offers the same functions. I didn't even had to change any line of the code.