Hi there,
I am attempting to export a worksheet as a text file using this code.
Sub RoundedRectangle2_Click()
ActiveSheet.SaveAs ThisWorkbook.Path & "\Purlinmacro3.spn", xlUnicodeText
End Sub
*I have tried multiple different file formats, including xlTextWindows, xlTextMSDOS, xlCSVWindows,xlCSV
I need the file to be in a .spn file, which is the exact same code as a text file. The macro successfully exports the file, in the correct format, however on each line there are quotation marks which render the file unreadable. Example.
I need the file to look like this (when opened with notepad)
"SupaZed"
"SZ15015","SZ15016","SZ15017","SZ15018","SZ15019","SZ15015","SZ15015","SZ15015","SZ15015","SZ15015","SZ15015","SZ15015"
"Single",0,0,5.85
4,8000,8000,8000,8000,0,7000,7000,7000,7000,7000,7000,7000,0,0
1,50,50,0,0
0,0,0,0,0
1,"%"
7.5,7.5
However, the file that is exported looks like this
"""SupaZed"""
"""SZ15015"",""SZ15016"",""SZ15017"",""SZ15018"",""SZ15019"",""SZ15015"",""SZ15015"",""SZ15015"",""SZ15015"",""SZ15015"",""SZ15015"",""SZ15015"""
"""Single"",0,0,5.85"
"4,8000,8000,8000,8000,0,7000,7000,7000,7000,7000,7000,7000,0,0"
"1,50,50,0,0"
"0,0,0,0,0"
"1,""%""
"7.5,7.5"
Could someone please suggest an alternative method that would solve this issue. Thankyou in advance.
I am attempting to export a worksheet as a text file using this code.
Sub RoundedRectangle2_Click()
ActiveSheet.SaveAs ThisWorkbook.Path & "\Purlinmacro3.spn", xlUnicodeText
End Sub
*I have tried multiple different file formats, including xlTextWindows, xlTextMSDOS, xlCSVWindows,xlCSV
I need the file to be in a .spn file, which is the exact same code as a text file. The macro successfully exports the file, in the correct format, however on each line there are quotation marks which render the file unreadable. Example.
I need the file to look like this (when opened with notepad)
"SupaZed"
"SZ15015","SZ15016","SZ15017","SZ15018","SZ15019","SZ15015","SZ15015","SZ15015","SZ15015","SZ15015","SZ15015","SZ15015"
"Single",0,0,5.85
4,8000,8000,8000,8000,0,7000,7000,7000,7000,7000,7000,7000,0,0
1,50,50,0,0
0,0,0,0,0
1,"%"
7.5,7.5
However, the file that is exported looks like this
"""SupaZed"""
"""SZ15015"",""SZ15016"",""SZ15017"",""SZ15018"",""SZ15019"",""SZ15015"",""SZ15015"",""SZ15015"",""SZ15015"",""SZ15015"",""SZ15015"",""SZ15015"""
"""Single"",0,0,5.85"
"4,8000,8000,8000,8000,0,7000,7000,7000,7000,7000,7000,7000,0,0"
"1,50,50,0,0"
"0,0,0,0,0"
"1,""%""
"7.5,7.5"
Could someone please suggest an alternative method that would solve this issue. Thankyou in advance.
Last edited: