When I substitute drive/path/file info and use the following, it works just fine.
Based on your error, I'm assuming that you are using a path that you do not have full access to. That would also explain why the CSV is empty. When the user opens the Excel file that has the above code in it, they have to have full access to the file and path.
You could have it send to an Excel format, but it would require additional coding to write to a file without opening it (you would use ADODB), find the end of the used range, and then put data into specific cells.
It's very easy for Excel to open, edit, and save a CSV.
Bookmarks