perhaps move the close file command to the end of the commands so its closed after the data is stored within the file.
example code
sync on : sync rate 60
Filename$ = "MyFile.txt"
if file exist(Filename$)=0
make file Filename$
endif
if file exist(Filename$) then delete file Filename$
open to write 1,Filename$
write string 1,"data information1"
write string 1,"data information2"
write string 1,"data information3"
write string 1,"data information4"
write string 1,"data information5"
write string 1,"data information6"
close file 1
print "file saved, press any key."
sync : sync : suspend for key
end