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