Receiving Error When Importing CSV File To Outlook

I am creating a csv file that will be imported into Outlook. When I do the import I am receiving an error that says:

"A file error has occurred in the Comma Separated Values translator while initializing a translator to build a field map.

Outlook was unable to retrieve the data from the file XXX. Verify that you have the correct file, that you have permission to open it, and that it is not open in another program."

I am attaching my code snippet and a screen shot of the error.

CodeSnippet.PNG (21.7 KB)

image.png (4.4 KB)

@cspurlock,

I spotted one line of code in your code segment is not right. So, please change the line of code:
i.e.,
OoxmlSaveOptions csvsaveOptions = new OoxmlSaveOptions(SaveFormat.Csv);
with:
TxtSaveOptions csvsaveOptions = new TxtSaveOptions(SaveFormat.Csv);

and give it a try again if you still find the issue.

Apparently, apart from the above line, your code is right and your issue does not seems to be related to Aspose.Cells APIs.

That worked. Thanks for your help.

@cspurlock,

Good to know that the suggested line of code figures out your issue now. Feel free to write us back if you have further comments or questions, we will be happy to assist you soon.