+ Reply to Thread
Results 1 to 4 of 4

Import CSV file in Excel using ADODB when values in the file have double quotes

  1. #1
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Import CSV file in Excel using ADODB when values in the file have double quotes

    Hello,
    I'm using ADODB to import a CSV file in Excel. I have done this many times (almost) without any problem. However now I have a csv file that has double quotes around each value. It turned out I have never had such case before. Any ideas how to import it correctly (i.e. without the quotes)? I assume it would be something in the connection string (extended properties?)...
    Of course I can always use the import from text feature but would prefer the ADODB approach.
    Thanks in advance.
    If you are pleased with a member's answer then use the Star icon to rate it.

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Import CSV file in Excel using ADODB when values in the file have double quotes

    Have you tried FMT=Delimited?

    https://msdn.microsoft.com/en-us/lib...or=-2147217396
    https://www.connectionstrings.com/textfile/

  3. #3
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Import CSV file in Excel using ADODB when values in the file have double quotes

    Quote Originally Posted by buran View Post
    I'm using ADODB to import a CSV file in Excel. [....] now I have a csv file that has double quotes around each value.
    Please provide examples of the form of data that is causing you grief (look at the CSV using Notepad), and explain what problem it causes. Also, what version of Excel are you using?

    There should be nothing wrong with putting double-quotes around everything. But Excel strips off double-quotes around numbers (including dates, percentages, currency; perhaps other numeric forms) and treats them as numbers, not text. I don't know what ADODB does.

    Excel also strips off double-quotes around non-numbers and treats them as text. But I encountered a surprise with Excel 2007. (I usually use Excel 2010.)

  4. #4
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Import CSV file in Excel using ADODB when values in the file have double quotes

    @Keneth Hobson - thanks, that worked.
    @joeu2004 - if you don't know what ADODB does, please, don't add spam to the thread. :-)

+ 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. SQL to count double quotes in a text file
    By Deutz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-15-2015, 10:49 PM
  2. [SOLVED] Double Quotes using Chr(34) and Extra Quotes when saving as text file
    By vamosj in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-26-2013, 12:26 PM
  3. Need double quotes when importing .csv file into text editor
    By rachelalbert in forum Excel General
    Replies: 0
    Last Post: 07-04-2012, 01:40 PM
  4. Error with using adodb Connection and double quotes
    By JimCo in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 07-23-2010, 11:19 AM
  5. Create csv file with double quotes on all fields
    By sugrue in forum Excel General
    Replies: 4
    Last Post: 05-29-2008, 01:20 PM
  6. CSV File with Double quotes
    By anandmr65 in forum Excel General
    Replies: 0
    Last Post: 08-25-2006, 02:44 AM
  7. CSV File with double quotes
    By NavSysEng in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-04-2006, 12:20 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