Is it Notepad, or me?

G

Guest

Guest
I'm am writing to a text file, called testfile.log through VBA in an excel app (XL2000). I am writing the current Date and Time to the file, and trying to put a carriage return at the end of each entry. I have tried using "vbCR", as well as Chr(13). The thing of it is, when I open the log file in Notepad, I get little rectangle characters were the carriage return is supposed to be. I realize this is an actual carriage return character, but I want it to do a carriage return. I've tried changing the way I open the file, ASCII, Unicode, etc.. that doesn't seem to work either. Also, if I open the log file with wordpad, it looks right. Please help....
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
1. I realize that is an option. But, it's a matter of convenience. When the file is double-clicked, it's going to open in Notepad and not Wordpad, and there are going to be numerous people opening this log file.

2. Word wrap is on.
 
Upvote 0
On 2002-03-12 12:36, charlie79 wrote:
Thanks for your help! I figured it out, I needed to be using vbCrLf instead of just vbCr! Duh..

/board/images/smiles/icon_smile.gif

I wondered about that... using CHAR(10) instead... but, you seemed pretty adament about using CHAR(13).
 
Upvote 0

Forum statistics

Threads
1,213,506
Messages
6,114,024
Members
448,543
Latest member
MartinLarkin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top