Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default How can I set encoding in EXCEL

My SQL Server 2000 is English version. Traditional Chinese words are
saved in some fields of a table. I used ADO.Recordset to read records
and save them into an EXCEL file. But when I open the EXCEL file, but
the traditional chinese words are unreadable. The following are my
code. I appreciate you kind help.

set objExcel = Server.CreateObject("Excel.Application")
objExcel.Visible = false
objExcel.Workbooks.Open(Server.MapPath("ExportExce l/Export_Template.xlt"))
objExcel.Sheets(1).select
set myWorksheet=objExcel.ActiveWorkbook.ActiveSheet

Rnum = 1
strRange="A"&Rnum&":b"&Rnum
while not rsSel.EOF
myWorksheet.range(strRange).value=array(rsSel("VNa me"),rsSel("VAddress"))
Rnum=Rnum+1
rsSel.MoveNext
wend
  #2   Report Post  
Posted to microsoft.public.excel.programming
jaf jaf is offline
external usenet poster
 
Posts: 300
Default How can I set encoding in EXCEL

Hi Lincy,
Don't know. I suspect you need to tell Excel what format the data is in
(unicode, codepage?).

I did notice in your code you are opening a template file.
Is that really what you want, to open the template for editing?

Maybe that should be...
objExcel.Workbooks.Add(Server.MapPath("ExportExcel/Export_Template.xlt"))

No idea if it makes a difference.

--
John

johnf202 at hotmail dot com
"Lincy" wrote in message
om...
My SQL Server 2000 is English version. Traditional Chinese words are
saved in some fields of a table. I used ADO.Recordset to read records
and save them into an EXCEL file. But when I open the EXCEL file, but
the traditional chinese words are unreadable. The following are my
code. I appreciate you kind help.

set objExcel = Server.CreateObject("Excel.Application")
objExcel.Visible = false

objExcel.Workbooks.Open(Server.MapPath("ExportExce l/Export_Template.xlt"))
objExcel.Sheets(1).select
set myWorksheet=objExcel.ActiveWorkbook.ActiveSheet

Rnum = 1
strRange="A"&Rnum&":b"&Rnum
while not rsSel.EOF

myWorksheet.range(strRange).value=array(rsSel("VNa me"),rsSel("VAddress"))
Rnum=Rnum+1
rsSel.MoveNext
wend



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
Character Encoding Casi12 Excel Worksheet Functions 1 September 8th 09 08:01 AM
encoding rollabones Excel Discussion (Misc queries) 0 April 15th 08 07:06 PM
xls, txt encoding JU Excel Discussion (Misc queries) 0 December 19th 07 08:15 PM
UTF-8 encoding CSV [email protected] Excel Discussion (Misc queries) 0 April 4th 06 02:33 AM
Excel 2003 and Content-Encoding:gzip Nicklas Karlsson Excel Discussion (Misc queries) 0 May 4th 05 07:59 AM


All times are GMT +1. The time now is 10:17 AM.

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"