I need to create a macro to write a .txt file and send it to our server, but our server only recognizes a new line, if there is an "enter" (chr 10) character at the end of the line. But everytime i write chr(10) at the end of the line, it creates a new line and macro writes at the next line of it like
Example (enter character sent here)
<---- new line
Next content
But server wont recognize the next content if the line before it is empty it must be like
Example (enter character sent here)
Next content
So far i have this to write the .txt file
Private Sub E16_Click()
Dim fs As Object
Set fs = CreateObject("Scripting.FileSystemObject")
Dim f As Object
Dim order
pedido = Sheets("EDI").Range("I2")
Set f = fs.OpenTextFile("c:\" & IIf(Range("AA24") = 2, "temp\", "") & "pc" & order & ".txt", 2, True)
f.writeline "ITP" & Sheets("EDI").Range("C2") & Sheets("EDI").Range("J2") & Sheets("EDI").Range("L2") & WorksheetFunction.Rept(" ", 75) ' **Enter character must be sent here**
f.writeline Sheets("EDI").Range("M2") ' **Enter character must be sent here**
f.writeline "AE3" & Sheets("EDI").Range("J2") & "04771370000183" & Sheets("EDI").Range("J2") & WorksheetFunction.Rept(" ", 83) ' **Enter character must be sent here**
Is there anyway to send an enter character without creating a new line? I tried to format the Enter character as a text and didnt work