Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default FileFormat:=xlTextPrinter saves only 240 characters of cell


Hi,

I am using the following code i.e ConvertPC_8ToANSI() to open a DOS
based text file and then save it to WINDOWS ANSI text file. My text
file contains long records of more than 300 characters, following
procedure loads the entire record into one cell and while saving it, it
saves only 240 characters and truncates the remaining characters of the
cell (record). Any body knows how to come out of this max. character
limitation.

Thanks in advance!

----------------------------------
Sub ConvertPC_8ToANSI()

Dim sFil As String
Dim tmpWorkBook As Workbook

sFil = "Z:\SOS-DB Pre Migration\PC_8_TO_ANSI\tsf\sample.tsf"

Workbooks.OpenText Filename:=sFil, DataType:=xlDelimited,
textqualifier:=xlTextQualifierNone, Origin:=xlMSDOS
Set tmpWorkBook = ActiveWorkbook
tmpWorkBook.SaveAs Filename:=Left(sFil, Len(sFil) - 4) & "_3.tsf",
FileFormat:=xlTextPrinter
tmpWorkBook.Close

End Sub


--
srinivasug
------------------------------------------------------------------------
srinivasug's Profile: http://www.excelforum.com/member.php...o&userid=33610
View this thread: http://www.excelforum.com/showthread...hreadid=533885

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default FileFormat:=xlTextPrinter saves only 240 characters of cell

I'm no expert, but here is guess at possible solution inasmuch as no one
else has responded to your inquiry. Can you structure the data retrival
using the Right( ) and Left( ) to first retrieve the first 60
characters and then the remaining characters, if there are more than 60?
Place the text in adjoining cells and in necessary, use "&" to
join at a later point? I would think that you have tried it already in
that obviously you are aware of the Right() function.



srinivasug wrote:
Hi,

I am using the following code i.e ConvertPC_8ToANSI() to open a DOS
based text file and then save it to WINDOWS ANSI text file. My text
file contains long records of more than 300 characters, following
procedure loads the entire record into one cell and while saving it, it
saves only 240 characters and truncates the remaining characters of the
cell (record). Any body knows how to come out of this max. character
limitation.

Thanks in advance!

----------------------------------
Sub ConvertPC_8ToANSI()

Dim sFil As String
Dim tmpWorkBook As Workbook

sFil = "Z:\SOS-DB Pre Migration\PC_8_TO_ANSI\tsf\sample.tsf"

Workbooks.OpenText Filename:=sFil, DataType:=xlDelimited,
textqualifier:=xlTextQualifierNone, Origin:=xlMSDOS
Set tmpWorkBook = ActiveWorkbook
tmpWorkBook.SaveAs Filename:=Left(sFil, Len(sFil) - 4) & "_3.tsf",
FileFormat:=xlTextPrinter
tmpWorkBook.Close

End Sub


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default FileFormat:=xlTextPrinter saves only 240 characters of cell

Hi

Excel can only parse 255 characters at a time so if there are more than
that then you need to run a routine to parse them all. This could be the
problem.

For example, something like this is needed.

Sp.Shapes("ReturnSlip").Select
With Selection
.Text = ""
For i = 0 To Int(Len(RH) / 255)
.Characters(.Characters.Count + 1).Text = Mid(RH, (i * 255) +
1, 255)
Next
End With

I think Chip Pearson explains what to on his help pages.

Hope this helps a little.

Andrew B

srinivasug wrote:
Hi,

I am using the following code i.e ConvertPC_8ToANSI() to open a DOS
based text file and then save it to WINDOWS ANSI text file. My text
file contains long records of more than 300 characters, following
procedure loads the entire record into one cell and while saving it, it
saves only 240 characters and truncates the remaining characters of the
cell (record). Any body knows how to come out of this max. character
limitation.

Thanks in advance!

----------------------------------
Sub ConvertPC_8ToANSI()

Dim sFil As String
Dim tmpWorkBook As Workbook

sFil = "Z:\SOS-DB Pre Migration\PC_8_TO_ANSI\tsf\sample.tsf"

Workbooks.OpenText Filename:=sFil, DataType:=xlDelimited,
textqualifier:=xlTextQualifierNone, Origin:=xlMSDOS
Set tmpWorkBook = ActiveWorkbook
tmpWorkBook.SaveAs Filename:=Left(sFil, Len(sFil) - 4) & "_3.tsf",
FileFormat:=xlTextPrinter
tmpWorkBook.Close

End Sub


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't reset Last Cell & Faster Excel Saves [email protected] Excel Discussion (Misc queries) 0 January 22nd 07 02:12 AM
Formula Saves In Cell But Does Not Compute roy.okinawa Excel Worksheet Functions 3 February 15th 06 05:09 AM
FileFormat:=xlCSV for a cell with =TODAY() gives unwantedamerican Crewman Excel Programming 4 March 5th 05 06:18 PM
Fileformat XLText JeepNC Excel Programming 1 February 14th 05 06:38 PM
Problem with xlTextPrinter? NooK[_48_] Excel Programming 3 August 6th 04 09:37 AM


All times are GMT +1. The time now is 08:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"