Wrox Programmer Forums
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 21st, 2007, 05:58 PM
Registered User
Join Date: May 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to chocobabe100 Send a message via Yahoo to chocobabe100
Default Imorting .csv into excel

Hi i want to import a csv file into excel . the file is imported but it does not put the comma separated values in different columns . Any help would b appreciated :) heres my code
                Excel.Application xlAppl;
            Excel._Workbook xlWB;
            Excel._Worksheet xlSheet;
            Excel.Range oRng;

                xlAppl = new Excel.Application();
                xlAppl.Visible = true;

                xlWB = (Excel._Workbook)(xlAppl.Workbooks.Add(Missing));
                xlSheet = (Excel._Worksheet)xlWB.ActiveSheet;

            //Add table headers going cell by cell.
                 xlAppl.Workbooks.Open(@"d:\csvtest.csv",false,fals e,5,"","",true,Excel.XlPlatform.xlWindows," ",true,false,null,false,null,false);

Old August 18th, 2007, 05:48 PM
Friend of Wrox
Join Date: May 2006
Posts: 246
Thanks: 0
Thanked 0 Times in 0 Posts

Are the commas present in the file?
Are there CRLF in the file?

Old August 18th, 2007, 09:25 PM
Friend of Wrox
Join Date: Oct 2006
Posts: 475
Thanks: 0
Thanked 9 Times in 9 Posts

Please post the first 6 and the last 6 lines of the text file.

--Jeff Moden

Similar Threads
Thread Thread Starter Forum Replies Last Post
Export ALL records from GridView into Excel or CSV kevorkian ASP.NET 2.0 Basics 7 June 17th, 2008 01:28 PM
Increase width for Excel and CSV reports diptypatil J2EE 0 October 23rd, 2007 06:36 AM
Change excel into csv format Ivanchan Excel VBA 4 July 5th, 2007 02:02 AM
Excel Vs CSV file - import performance itHighway Classic ASP Databases 0 August 5th, 2006 03:40 PM
CSV and Excel sheet import itHighway Classic ASP Professional 0 August 5th, 2006 08:25 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.