Home » Infrastructure » Unix » How to save a CSV (having non-English characters) file as XLS file
How to save a CSV (having non-English characters) file as XLS file [message #231146] Sun, 15 April 2007 01:58 Go to next message
shwetabhandari02
Messages: 5
Registered: April 2007
Junior Member
Hello,

I need to convert a CSV file as XLS. Below is the code I am using.
-------------------------------------------------------------
-------------------------------------------------------------


Dim myXL
Dim strfileName As String

strfileName = "c:\ACS\" & (Dir("c:\ACS\*.csv", vbNormal))
Set myXL = CreateObject("excel.application")
myXL.Workbooks.Open strfileName
myXL.DisplayAlerts = False
myXL.ActiveWorkbook.SaveAs "c:\ACS\Dailyalert.xls", -4143
myXL.DisplayAlerts = True
myXL.ActiveWorkbook.Close False

Set myXL = Nothing


-------------------------------------------------------------
-------------------------------------------------------------

The problem is that the CSV file also has non-English(Asian) characters which gets corrupted when in the XLS file.
Is there a way to convert a CSV file into XLS file so that the non-English characters also gets saved?
Thanks and Regards,
Shweta Bhandari
Re: How to save a CSV (having non-English characters) file as XLS file [message #231174 is a reply to message #231146] Sun, 15 April 2007 09:48 Go to previous messageGo to next message
BlackSwan
Messages: 25036
Registered: January 2009
Location: SoCal
Senior Member
>The problem is that the CSV file also has non-English(Asian) characters which gets corrupted when in the XLS file.
I don't know if the statement above is correct or not.
The file may appear to be corrupt based upon the observation when using a tool/utility that does NOT know how to properly display the non-ASCII character.
If I were you I'd FTP the file in binary mode to a *nix system.
$ od -x sample.xml | more
to see what is actually inside the file.
Also the contents may be impacted by the NLS settings at the OS level.

I have a procedural question for you.
Why is this posted in the Unix forum when it appears to be based upon a problem on a Windoze operating system ("c:\ACS\" & (Dir("c:\ACS\*.csv")?

HTH & YMMV

[Updated on: Sun, 15 April 2007 10:10] by Moderator

Report message to a moderator

Re: How to save a CSV (having non-English characters) file as XLS file [message #231175 is a reply to message #231174] Sun, 15 April 2007 12:29 Go to previous message
shwetabhandari02
Messages: 5
Registered: April 2007
Junior Member
My appologies for posting the request to the wrong forum!
Shweta..
Previous Topic: error plz help me
Next Topic: Ceck if the variable lies in a particular range
Goto Forum:
  


Current Time: Sun Dec 04 18:37:50 CST 2016

Total time taken to generate the page: 0.08688 seconds