This is the first time I have tried to write a file from Excel using Open. I normally use FSO, but this code has to run on both Windows and MacOS.
Dim myFile As String
myFile = Application.ActiveWorkbook.Path & "\" & "CGATS.txt"
Open myFile For Append As #1
Write #1, "NUMBER_OF_FIELDS"
Write #1, "BEGIN_DATA_FORMAT"
Write #1, "SAMPLE_ID"
Write #1, "END_DATA_FORMAT"
Write #1, ""
Write #1, "NUMBER_OF_SETS" & vbTab & numRows
Write #1, "BEGIN_DATA" & vbTab & "LAB_L" & vbTab & "LAB_A" & vbTab & "LAB_B"
The code runs, but every line of output is surrounded by quotation marks
"NUMBER_OF_FIELDS"
"BEGIN_DATA_FORMAT"
"SAMPLE_ID"
"END_DATA_FORMAT"
""
"NUMBER_OF_SETS 52"
"BEGIN_DATA LAB_L LAB_A LAB_B"
Why is Excel doing this, and how do I get rid of the quotation marks?