Change vbNewLine on Excel VBA (Office 2004 Mac OS X)

I

Ismannen

I would like to avoid using 0x0D as new line when I write a text file from
Excel VBA:
Open "Testfile.txt" For Output As #1
Print #1, "Hello"
Print #1, "World"
Close #1
Doing it in the above manner gives me annoying ^M instead of newline on Mac
(using
"less" for example). Is there a way of changing vbNewLine to something more
....
sensible ...
 
S

Steve Rindsberg

Ismannen said:
I would like to avoid using 0x0D as new line when I write a text file from
Excel VBA:
Open "Testfile.txt" For Output As #1
Print #1, "Hello"
Print #1, "World"
Close #1
Doing it in the above manner gives me annoying ^M instead of newline on Mac
(using
"less" for example). Is there a way of changing vbNewLine to something more
....
sensible ...

I don't think so. But you could cobble up the entire string ...

strTemp = "Hello" & vbCr
strTemp = strTemp & "World" & vbCr

then finally Print just strTemp to file.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top