All seems to be working now with the primary concern of fixing the file becoming corrupt. It seems to have been the variable size as you suggested. Thank you for the tip and for taking the time to look into it! I'll mark this as solved and probably make a new post with better title about getting the function performance fixed if I still need to after trying out arrays. Thanks again!