f1 = FREEFILE
OPEN file FOR whatever AS #f1
f2 = FREEFILE
Etc. You have to use the values to CLOSE them later. FREEFILE value will not change until you USE the number by opening it.
CLOSE by itself or CLEAR will close all open files.
If you don't get it working, post the code portion dealing with files.