You do not have permission to write to the path and or file.
1) Check that you don't already have the file open (Did you load it and not close the file?)
2) Try writing to a different directory (Such as Documents).
3) Validate that you are using the correct method to write the file
You could try running the game as Admin and see if you get the error as well. If you don't then you know it's a permissions issue.