View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
KI LEE KI LEE is offline
external usenet poster
 
Posts: 9
Default Write Line problem when writing simplified chinese characters

Thx reply. The exception raise on row

ts.WriteLine (strFieldValue)

the msg is "Invalid Procedure Call or argument"

Can u tell me how to "writing in unicode"?

Cause I check that Excel cannot resolve all of the simplied chinese
character and so only show the "?" for such unknown characters?

Many Thx.


"Gareth" wrote:

Right of the bat I should confess I don't speak Chinese or have any
experience of handling it. I've played around with Arabic though so
maybe that had similar problems:

Which line does your procedure fail at?
strFieldValue = rngRange.Cells(1, 1)
or
ts.WriteLine (strFieldValue)

What is the error message?

How many characters are there in the simplified chinese characterset?
More than 256 say and therefore we need to be writing in unicode - or
does "simple" imply this is a single byte character set?

KI LEE wrote:
Hi All,

I am facing a problem that when using Excel to write worksheet value to text
file, the process failure if the cell vlaue has simplified chinese characters.

I am using Win 2000 Prof (Traditional Chinese version) and MS Office 2000
(Traditional Chinese version), Anyone can help? Many thanks.

----- Sample Code -----
Public Sub test()

Dim fso As New FileSystemObject
Dim ts As TextStream
Set ts = fso.CreateTextFile("c:\output.txt")

Dim wrkSheet As Worksheet
Dim rngRange As Excel.Range

Set wrkSheet = ThisWorkbook.Sheets.Item(1)
Set rngRange = wrkSheet.UsedRange

Dim strFieldValue As String

strFieldValue = rngRange.Cells(1, 1)

ts.WriteLine (strFieldValue)

End Sub

The cell(1,1) contains value "财产"