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. C# and Excel

C# and Excel

Scheduled Pinned Locked Moved C#
csharpcomquestion
5 Posts 5 Posters 0 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.
  • P Offline
    P Offline
    prithaa
    wrote on last edited by
    #1

    Hello, I have used using System.Globalization; using Excel = Microsoft.Office.Interop.Excel; in m y project so that I can write my data to excel which works fine when I include the Microsoft object library 12 in my project. But when I load my program on some other pc the object file 12 is not there with the PC and my code gives errors. What should be done? Pritha

    G R A A 4 Replies Last reply
    0
    • P prithaa

      Hello, I have used using System.Globalization; using Excel = Microsoft.Office.Interop.Excel; in m y project so that I can write my data to excel which works fine when I include the Microsoft object library 12 in my project. But when I load my program on some other pc the object file 12 is not there with the PC and my code gives errors. What should be done? Pritha

      G Offline
      G Offline
      Garth J Lancaster
      wrote on last edited by
      #2

      Ive done similar in c++ and it seems that you really need to know which version of excel is on the PC, since it seems to be very hard to do what I would call a 'late bind' to the comm object depending on version. Does your c# program crash straight away ? The only 100% foolproof way Ive found in c++ is to instanciate the excel object, get the excel version number, and if its not what I expect (ie, when I build the program and imported the type library for excel version x), exit the program gracefully .. I dont know if that helps at all, since I havnt had to use c# yet to do it 'g'

      1 Reply Last reply
      0
      • P prithaa

        Hello, I have used using System.Globalization; using Excel = Microsoft.Office.Interop.Excel; in m y project so that I can write my data to excel which works fine when I include the Microsoft object library 12 in my project. But when I load my program on some other pc the object file 12 is not there with the PC and my code gives errors. What should be done? Pritha

        R Offline
        R Offline
        RCoate
        wrote on last edited by
        #3

        You can use

        using System.Data.SQLClient;
        

        and extract and write data to excel. Just use an excel sql connection string and treat excel like a database. ConnectionStrings.com is your friend.

        1 Reply Last reply
        0
        • P prithaa

          Hello, I have used using System.Globalization; using Excel = Microsoft.Office.Interop.Excel; in m y project so that I can write my data to excel which works fine when I include the Microsoft object library 12 in my project. But when I load my program on some other pc the object file 12 is not there with the PC and my code gives errors. What should be done? Pritha

          A Offline
          A Offline
          Abhinav S
          wrote on last edited by
          #4

          I faced a problem with office 10 when office CDO objects were needed to be installed on a client machine. This could be something similar to what you are facing here.

          My signature "sucks" today

          1 Reply Last reply
          0
          • P prithaa

            Hello, I have used using System.Globalization; using Excel = Microsoft.Office.Interop.Excel; in m y project so that I can write my data to excel which works fine when I include the Microsoft object library 12 in my project. But when I load my program on some other pc the object file 12 is not there with the PC and my code gives errors. What should be done? Pritha

            A Offline
            A Offline
            Anas Abbas
            wrote on last edited by
            #5

            Peace be upon those who follow true guidance Hello This Problem is very easy You can install Microsoft office in new PC , only . Because, This library (Microsoft Excel 12.0 object library ) come with Microsoft office 2007 . Regards Dr Anas Abbas

            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