Is there an Excel text file format (XlFileFormat) to export that will not put quotation marks around strings? I've tried xlTextWindows. Maybe there is an additional setting I'm missing?
Most of the time, the datasets I'm exporting are in CSV, but I have a situation where I still want to export with an Excel type (long story) but really it is just a small blob of text. Otherwise, I'd just export to a text file; trying to avoid that for this one case.
[Edit] In this case, I have an Excel workbook with a single worksheet, with one cell (No header) with the text:
[Reports]
When saved, the text file contains:
"[Reports]"
because it is a text field and that is what Excel does when it saves it to a text file.
For this purpose, it cannot contain any surrounding quotation marks or any other characters.
I will probably end up using a FileStream and StreamWriter, but would like to see if this can be avoided.
[Additional Edit]
What the app does:
It Loops through the rows of a datatable and place the value for each column in an Excel workbook sheet cell.
This works great when you want it to truely be an Excel file or a .CSV file. I have an instance where I need to save a single cell's text to a text file, Excel insists on enclosing the text with quotation marks. I don't know about anyone else, but when I save something in Notepad, I don't add quotation marks. The application that wants to read this file, doesn't like the text enclosed in quotation marks either. There is no need to escape quotation marks if they 'happen' to be in the chunk of text, but they should never be added. Nothing should be added. It should just be a block of text in the same format it was in the Datatable.
Save the Excel workbook using
ExcelWorkbook.SaveAs