Read the error message - it's pretty clear:
failed due to the following error: 80070005 Access is denied.
Some part of the path you are trying to save to is not shared to the user that is executing the application with sufficient permission to create or modify the file you specify.
Check the content of the excelPath and csvPath variables, and check what the folder access rights are. If this used to work in dev but fails in prod, it's very likely that you are using the app executable folder to store your data, and that won't work.
We can't do any of that for you - we have no access to your systems!