VB.NET Export to Excel with Non-Quoted String Data

Is there an Excel text file format (XlFileFormat) for export that will not put quotation marks around strings? I tried xlTextWindows. Maybe there is an additional setup that I am missing?

In most cases, the data that I export is in CSV, but I have a situation where I still want to export with the Excel type (long history), but in reality it is just a little text. Otherwise, I would just export to a text file; trying to avoid this in this case.

[edit] In this case, I have an Excel workbook with one worksheet with one cell (no title) with text:

[Reports]

When saving, the text file contains:

"[Reports]"

because it is a text field, and this is what Excel does when it saves it in a text file.

For this purpose, it cannot contain any surrounding quotation marks or any other characters.

I will probably end up using FileStream and StreamWriter, but would like to see if this can be avoided.

[Additional editing]

What the application does:

It cycles through the rows of data and places a value for each column in the cell sheet of an Excel workbook sheet.

, , Excel .CSV. , , Excel , . , - "", . , , , . , "" , . . , Datatable.

Excel

ExcelWorkbook.SaveAs

+3
3

( ): enter image description here

+1

SpreadsheetML. :
Excel ASP.NET

xml, CDATA, ".

0

Did not try, but can help

What if you try this with a few ugly steps.

  • Saving data in CSV format - direct text with comma-delimited, without quotes (as you need. Use CSV extensions)
  • Download CSV to Excel via code
  • Save the file in Excel XLS (S) format using code

He can then skip adding quotes to the text in the cells in the XLS (S) file that he saved.

0
source

Source: https://habr.com/ru/post/1788671/


All Articles