p4p800 Posted March 3, 2004 Posted March 3, 2004 i want this to have two columns in excel can i do that Dim writer As New System.IO.StreamWriter("test.xls") writer.Write(ComboBox1.Items(0)) writer.Write(ComboBox1.Items(1)) writer.WriteLine(a) writer.WriteLine(b) writer.Flush() writer.Close() Quote
*Experts* mutant Posted March 3, 2004 *Experts* Posted March 3, 2004 (edited) Im sure Excel format is much more complicated than that so I think that won't work. Edited March 3, 2004 by mutant Quote
Leaders Iceplug Posted March 3, 2004 Leaders Posted March 3, 2004 The 'easiest' way would probably be to add the Reference to the MS Excel ##.# library, create your workbooks and worksheets through code, or somehow, and then use Excel library methods to save an excel .Xls spreadsheet file. :) Quote Iceplug, USN One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(
TechnoTone Posted March 4, 2004 Posted March 4, 2004 If you don't care about formatting, you can write a file in CSV (Comma Separated Values) format. This involves placing a comma between each column and surrounding each column with "". End each row with a new line. CSV files will open in Excel - Excel is the default program associated with them. Dim writer As New System.IO.StreamWriter("test.xls") writer.Write("""" & ComboBox1.Items(0) & """,") writer.Write("""" & ComboBox1.Items(1) & """") writer.WriteLine() writer.Close() Quote TT (*_*) There are 10 types of people in this world; those that understand binary and those that don't.
filip Posted July 14, 2009 Posted July 14, 2009 Hi, easiest way to work with Excel in .NET is by using 3rd party component. You can try GemBox.Spreadsheet - Excel component for .NET that is free to use if you have files smaller then 150 rows. Here you can see a list of reasons why GemBox.Spreadsheet is better to use when working with Excel then Excel Automation. Filip GemBox.Spreadsheet - easiest way to read and write Excel files in .NET Quote
gbucsariu Posted August 31, 2012 Posted August 31, 2012 Hi! Take a look at EasyXLS library. It's very easy to use and there is also a User Guide available on their website. Quote
Agent707 Posted September 5, 2012 Posted September 5, 2012 Wow, this forum doesn't get much action. 3 posts this year... including an 8 year old thread necro. Quote
Recommended Posts