Comment on Tutorial - How to export from DataGridView to excel using VB.net By Issac
Comment Added by : Zarno
Comment Added at : 2010-12-24 07:11:19
Comment on Tutorial : How to export from DataGridView to excel using VB.net By Issac
Dim xlApp As Excel.Application
Dim xlWorkBook As Excel.Workbook
Dim xlWorkSheet As Excel.Worksheet
Dim misValue As Object = System.Reflection.Missing.Value
xlApp = New Excel.ApplicationClass
xlWorkBook = xlApp.Workbooks.Add(misValue)
xlWorkSheet = xlWorkBook.Sheets("Feuil1")
For Each col As DataGridViewColumn In DG_ENCOURS.Columns
'noms des colonnes
xlWorkSheet.Cells(1, col.Index + 1) = col.HeaderText
For Each rowa As DataGridViewRow In DG_ENCOURS.Rows
xlWorkSheet.Cells(rowa.Index + 2, col.Index + 1) = rowa.Cells(col.Index).Value
Next
Next
xlApp.Visible = True
View Tutorial
- Data Science
- Android
- AJAX
- ASP.net
- C
- C++
- C#
- Cocoa
- Cloud Computing
- HTML5
- Java
- Javascript
- JSF
- JSP
- J2ME
- Java Beans
- EJB
- JDBC
- Linux
- Mac OS X
- iPhone
- MySQL
- Office 365
- Perl
- PHP
- Python
- Ruby
- VB.net
- Hibernate
- Struts
- SAP
- Trends
- Tech Reviews
- WebServices
- XML
- Certification
- Interview
categories
Subscribe to Tutorials
Related Tutorials
Program using concept of byte long short and int in java
Update contents of a file within a jar file
Tomcat and httpd configured in port 8080 and 80
Count number of vowels, consonants and digits in a String in Java
Student marks calculation program in Java
Calculate gross salary in Java
Calculate average sale of the week in Java
Vector in Java - Sample Program
MultiLevel Inheritance sample in Java
Archived Comments
1. Thanks bro...you save me from a great problem...ve
View Tutorial By: Tishan at 2012-07-09 09:14:07
2. very nice and i need the code for this.. can u sen
View Tutorial By: bala at 2008-05-14 04:51:07
3. I get an error returned saying the SMPT server req
View Tutorial By: Christian Peut at 2011-04-04 04:35:51
4. hey i can write more simple example of this pointe
View Tutorial By: shruti at 2010-03-03 09:44:58
5. My exchange email account is only partially delete
View Tutorial By: ali at 2010-12-30 02:38:14
6. Now what the hell does all this mean???
To
View Tutorial By: Søren at 2011-09-22 03:13:53
7. hi.t.join();
wat would make the hi thread
View Tutorial By: preeti at 2011-07-19 05:28:11
8. realy i enjoy it for visit your site. and i unders
View Tutorial By: vinod balot at 2015-02-09 17:43:30
9. Nice Article....
View Tutorial By: Vipin Joshi at 2008-04-13 15:35:42
10. Been looking at several website for a clear explan
View Tutorial By: Jase at 2011-08-09 12:00:10