jeffandtamara
New Member
- Joined
- Apr 27, 2009
- Messages
- 18
Help.....
I am writing out a Fixed record length text file. The Text has to be a fixed length. Life was good until a user input 61" as part of the Comment field. The field is defined as 30 characters.
Code to write it out was :
Comments = String(30 - Len(Left(ActiveSheet.Cells(Row, 31), 30)), " ") & Left(ActiveSheet.Cells(Row, 31), 30)
Write Statement:
Write #1, Lot, LotStatus, ... , Comments, ...
OUTPUT:
," HAD TROUBLE WITH SCRAP 61""",
For some reason I am getting a 31 Character length field, because of the embeded quotation mark. I have tried all kinds of text manipulation. When I do a Len(comments) on the field, I get a length of 30, but when it writes out it wants to add an extra quatation mark that makes the field 31 characters not 30.... Any ideas???
I am writing out a Fixed record length text file. The Text has to be a fixed length. Life was good until a user input 61" as part of the Comment field. The field is defined as 30 characters.
Code to write it out was :
Comments = String(30 - Len(Left(ActiveSheet.Cells(Row, 31), 30)), " ") & Left(ActiveSheet.Cells(Row, 31), 30)
Write Statement:
Write #1, Lot, LotStatus, ... , Comments, ...
OUTPUT:
," HAD TROUBLE WITH SCRAP 61""",
For some reason I am getting a 31 Character length field, because of the embeded quotation mark. I have tried all kinds of text manipulation. When I do a Len(comments) on the field, I get a length of 30, but when it writes out it wants to add an extra quatation mark that makes the field 31 characters not 30.... Any ideas???