in reply to writing to an open Excel file

Howdy bts974, and welcome to the Monastery!

I can't say much without having seen your script or knowing what error message you're getting, but my first guess is that Excel is holding a lock of your file that keeps it from being written to by another application/program/script while it's open.

The solution is to close the file in Excel before you run your script, and reopen it afterwards. (The alternative would be to file a bug report with Microsoft, but I believe that's unlikely to lead anywhere.)