+ Reply to Thread
Results 1 to 4 of 4

Saving Excel files as CSV with Unicode support

  1. #1
    Registered User
    Join Date
    08-28-2008
    Location
    Latvia
    Posts
    10

    Saving Excel files as CSV with Unicode support

    Hi,

    I'm working with Excel 2003 and have constant problems with saving data as CSV - characters that are not in the standard Latin alphabet are converted into question marks (?). It looks like Excel blindly applies ANSI encoding instead of full Unicode or UTF-8 and I see no option where to choose this encoding. I remember this was happening with earlier releases of Excel as well.

    Is there a way to enforce the correct encoding for CSV exports?

    The workaround I know is to export the Excel file through a temporary Access database, which then allows to choose any desired encoding but I want to learn a more direct method so that non-technical users could do it as well.

    Thanks.

  2. #2
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264
    Hi

    The File Scripting Object's (part of Microsft's Scripting Runtime library) CreateTextFile method allows you to specify unicode output for the text file. So you'd just need some code to produce the output string to write to the csv file.

    Here's a brief example I wrote for someone else on MrExcel.com and also a link to another functon I wrote which could produce the string to be written to the text file created by the FSO:

    CreateTextFile:

    http://www.mrexcel.com/forum/showthread.php?t=338526

    Create string to be written:

    http://www.mrexcel.com/forum/showthr...=binary+access

    Richard

  3. #3
    Registered User
    Join Date
    08-28-2008
    Location
    Latvia
    Posts
    10
    Nay... That's programming I've already developed a similar function to render CSV in code but I need a non-programming solution.

    It looks like using Access as the intermediary is still the only solution for non-techies. Oh well. Sometimes Microsoft weirdly loves to keep their bugs for years.

  4. #4
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264
    I agree it seems a bit odd that there's no default option to save as unicode in the SaveAs. Would be useful...

    Sorry I was no help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Creating an Excel list of Excel Files
    By kasimagj in forum Excel General
    Replies: 5
    Last Post: 01-13-2009, 01:58 PM
  2. Excel 2003 SP3 - Compare Excel files
    By Trotamundos in forum Excel General
    Replies: 7
    Last Post: 10-06-2008, 10:05 AM
  3. Excel files won't open:blank excel interface
    By moding blaine in forum Excel General
    Replies: 5
    Last Post: 07-29-2008, 05:02 PM
  4. Excel Crashes when saving after running Userform
    By jjking57 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-10-2007, 12:43 PM
  5. Opening Excel files from Windows Explorer
    By andres01 in forum Excel General
    Replies: 2
    Last Post: 05-06-2007, 10:48 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1