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



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. im biginner of java programming, please give me in
View Tutorial          By: siva at 2011-11-04 06:40:45

2. The code gives the following exception :-
<

View Tutorial          By: swetha at 2009-03-12 07:19:23

3. it is very good for best practice of basics.......
View Tutorial          By: sushil ghimire at 2015-03-01 13:27:57

4. Thank you for such a article. It is extreamly nice
View Tutorial          By: Ravi at 2011-08-23 10:04:14

5. hi
Instead of sending a int type pass an ar

View Tutorial          By: Sanju at 2014-12-04 08:51:18

6. Please send me application for sending message on
View Tutorial          By: jigar at 2011-12-21 11:53:48

7. pls send more tutorial on my id
View Tutorial          By: vipin at 2012-11-17 07:23:49

8. This is very clear and explains the concepts in a
View Tutorial          By: Reite at 2011-02-18 13:55:07

9. Good explanation, Thanks.
View Tutorial          By: bram at 2011-05-06 03:37:54

10. i WROTE A FILE READER LIKE IT WAS IN THE SAMPLE BU
View Tutorial          By: LILI at 2011-11-06 01:47:20