![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Guest
Posts: n/a
|
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....
|
|
|
|
#2 |
|
Board Regular
Join Date: Feb 2002
Location: Houston,Texas
Posts: 418
|
1. open the file in Wordpad instead of notepad.
2.In notepad choose FORMAT and click on Word Wrap |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Posts: 97
|
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. |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Feb 2002
Location: Houston,Texas
Posts: 418
|
Could you post the code you're using to create the log file?
|
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Feb 2002
Posts: 97
|
Thanks for your help! I figured it out, I needed to be using vbCrLf instead of just vbCr! Duh..
|
|
|
|
|
|
#6 |
|
Board Regular
Join Date: Feb 2002
Location: Houston,Texas
Posts: 418
|
I'ld say you're welcome if I'ld done anything to help!
|
|
|
|
|
|
#7 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
Quote:
|
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|