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



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

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions 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

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. Can u tell me more about struts related to databas
View Tutorial          By: archana at 2010-09-15 04:38:54

2. If I want to read input from A PDF what should I d
View Tutorial          By: thiru at 2015-08-12 10:57:51

3. Hi,
how can make a report to display one re

View Tutorial          By: david at 2013-08-30 16:09:23

4. This website is great for the students who want to
View Tutorial          By: Parth Patalia at 2009-11-19 21:09:24

5. excellent to easy going
View Tutorial          By: murali at 2009-11-15 23:13:21

6. sooooooooooooooooo gr8 jop!!
View Tutorial          By: monti at 2011-06-14 08:40:55

7. please send me the code of this movable clock and
View Tutorial          By: dafi at 2008-05-14 05:06:08

8. I had downloaded all 5 the file
but i need

View Tutorial          By: Dhananjay at 2009-12-09 10:20:30

9. It is very useful ....Thank U sooo much dear...
View Tutorial          By: Augustine Francis at 2014-06-24 16:55:21

10. Thanks for the explicit introduction!
View Tutorial          By: yemi at 2010-01-13 03:28:14