Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to convert CSV file to XLS file using C# Programme

How to convert CSV file to XLS file using C# Programme

Scheduled Pinned Locked Moved C#
csharptutorialquestion
6 Posts 5 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    liyakhat_shahid
    wrote on last edited by
    #1

    Hi frinds, My Question is simple. How to convert the CSV file to XLS file using the C# Programming langueage. Thanks, Liyakhat.

    B J M P 4 Replies Last reply
    0
    • L liyakhat_shahid

      Hi frinds, My Question is simple. How to convert the CSV file to XLS file using the C# Programming langueage. Thanks, Liyakhat.

      B Offline
      B Offline
      Bijesh
      wrote on last edited by
      #2

      You can use the Excel Application object Microsoft.Office.Interop.Excel namespace...

      L 1 Reply Last reply
      0
      • L liyakhat_shahid

        Hi frinds, My Question is simple. How to convert the CSV file to XLS file using the C# Programming langueage. Thanks, Liyakhat.

        J Offline
        J Offline
        Jimmanuel
        wrote on last edited by
        #3

        try using Google[^] - the first result gives you a full code example of the answer to your problem

        1 Reply Last reply
        0
        • L liyakhat_shahid

          Hi frinds, My Question is simple. How to convert the CSV file to XLS file using the C# Programming langueage. Thanks, Liyakhat.

          M Offline
          M Offline
          martin_hughes
          wrote on last edited by
          #4

          Have a look at this article: http://www.codeproject.com/csharp/csharp_csv_fileparser.asp[^]

          1 Reply Last reply
          0
          • L liyakhat_shahid

            Hi frinds, My Question is simple. How to convert the CSV file to XLS file using the C# Programming langueage. Thanks, Liyakhat.

            P Offline
            P Offline
            Pete OHanlon
            wrote on last edited by
            #5

            Christian answered this question for you when you asked it yesterday and Jamie answered it the day before. Please don't repost questions. You need to understand that people here will normally give you the hints/areas that you need to look at in order to complete your task. They will not give you the complete application. You are expected to do some work on your own, and having been told to look at office Interop it is not unreasonable to think that you will have used <> to research the topic. If you have a problem with code then tell us what you have done, where the problems are and what they are. At that stage, we will be able to provide more help.

            Please visit http://www.readytogiveup.com/ and do something special today. Deja View - the feeling that you've seen this post before.

            1 Reply Last reply
            0
            • B Bijesh

              You can use the Excel Application object Microsoft.Office.Interop.Excel namespace...

              L Offline
              L Offline
              liyakhat_shahid
              wrote on last edited by
              #6

              Hi Bijesh, First of all thanks, I got the code to Convert CSV file to XLS file using Excel Application object. My code: using System; using System.Collections.Generic; using System.Text; using System.Reflection; using Microsoft.Office.Interop.Excel; namespace File_Conversion { class Program { static void Main(string[] args) { ApplicationClass app = new ApplicationClass(); Workbook doc = app.Workbooks._Open( @"C:\GCProject\Input Example.csv", Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, false, Missing.Value, Missing.Value, false); Console.WriteLine("Reading CSV File........"); doc.SaveAs( @"C:\GCProject\Output.xls", XlFileFormat.xlWorkbookNormal, Missing.Value, Missing.Value, Missing.Value, Missing.Value, XlSaveAsAccessMode.xlExclusive, Missing.Value, false, Missing.Value, Missing.Value, Missing.Value); doc.Saved = true; Console.WriteLine("Converted CSV to XLS file"); app.Quit(); Console.ReadLine();

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups