- Nov 2, 2004
- 1,460
- 2
- 81
I wrote a small command line based program to convert xlsx and xls files to comma delimited. Now I am trying to make it to where field framers are put around every field. (ex. "field1","Field2") The problem is no matter what I try I wind up getting """field1""","""field2""". Below is what I have tired so far.
xlsheet.Cells(i, i2).value = Chr(34) & Storage & Chr(34)
xlsheet.Cells(i, i2).value = """" & Storage & """"
xlsheet.Cells(i, i2).value = "\" & Storage & \""
Im using vb.net 2010. Any help would be appriciated.
Thanks!
****UPDATE****
I threw in a debugging statement to show a msgbox of the cell contents before and after I added the " and the cell contents is correct..it shows "field". So I'm guessing it has to do with when I'm saving and here is my statement.
xlsheet.SaveAs(Filename:=finalfile, FileFormat:=Excel.XlFileFormat.xlCSV) 'saves format in csv format
xlsheet.Cells(i, i2).value = Chr(34) & Storage & Chr(34)
xlsheet.Cells(i, i2).value = """" & Storage & """"
xlsheet.Cells(i, i2).value = "\" & Storage & \""
Im using vb.net 2010. Any help would be appriciated.
Thanks!
****UPDATE****
I threw in a debugging statement to show a msgbox of the cell contents before and after I added the " and the cell contents is correct..it shows "field". So I'm guessing it has to do with when I'm saving and here is my statement.
xlsheet.SaveAs(Filename:=finalfile, FileFormat:=Excel.XlFileFormat.xlCSV) 'saves format in csv format
Last edited: