Good morning to both of you,
Apologies for not having replied sooner, but I couldn't get ahold of the code to test it until today.
As roberttanenbaum said, it was the email sending process not releasing the file. I commented the whole block where the mail was being sent and the File.Delete line worked like a charm.
Thanks for both of your replies, and especially to the ClosedXML crew for making such a wonderful piece of code.
Good day!
Apologies for not having replied sooner, but I couldn't get ahold of the code to test it until today.
As roberttanenbaum said, it was the email sending process not releasing the file. I commented the whole block where the mail was being sent and the File.Delete line worked like a charm.
Thanks for both of your replies, and especially to the ClosedXML crew for making such a wonderful piece of code.
Good day!