+ Reply to Thread
Results 1 to 4 of 4

Created a CSV file using macros but when exported to excel contains special character

  1. #1
    Registered User
    Join Date
    09-19-2008
    Location
    Singapore
    Posts
    41

    Unhappy Created a CSV file using macros but when exported to excel contains special character

    Hi All,

    I have written a macro to create a csv file. What I am doing is to write the data into the columns and then saving the file as "CSV". But now when I am trying to open the CSV using the export external data option in excel its displaying special characters as the data content.

    But when I open the file by double clicking on it the data is rendered correctly.
    Please help. Attaching the code below.

    Please Login or Register  to view this content.
    Last edited by Aswathy; 10-23-2008 at 02:48 AM.

  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
    This is a guess, but try telling Excel you actually want to save the file as a csv file. Do this on your SaveAs line:

    Please Login or Register  to view this content.
    Richard
    Richard Schollar
    Microsoft MVP - Excel

  3. #3
    Registered User
    Join Date
    09-19-2008
    Location
    Singapore
    Posts
    41
    Hey ,

    It worked thanks a lotttttttttttttttttttt.........

    Cheers,
    Aswathy

  4. #4
    Registered User
    Join Date
    09-19-2008
    Location
    Singapore
    Posts
    41

    CSV file created opens fine when exported to excel, double click open is not working

    Hi All,

    The problem that I posted in this thread is persisting, but this time its the other way round. The code that I have written does the following things.
    1. Opens a workbook and saves it as a csv
    2. Opens again, writes the data in each cell
    3. Saves and Closes the file

    The file is created, and now
    1. when I double click and open the file the data in each row appears together and not in separate columns.
    2. When I export the data into the excel it opens and shows the data properly
    3. When I open the CSV in a text editor like EditPlus the weird thing is the separator comma is not to be found anywhere. and the separator is tab space

    I am not able to attach the file since the format CSV is not support in the attach section. The code is the same except that
    Please Login or Register  to view this content.
    as suggested by Richard have been added to it

    Please help

    Cheers,
    Aswathy
    Last edited by Aswathy; 10-23-2008 at 03:18 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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