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

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

Java program to check if user input is an even number

Archived Comments

1. Thanks ,got useful information on toString().
View Tutorial          By: jaffar at 2011-08-01 10:15:04

2. thanks....good explanation...
View Tutorial          By: jiby at 2012-01-14 05:57:33

3. thank you..!!
really very helpful...

View Tutorial          By: sneha at 2012-01-30 18:01:16

4. i am not getting output by using this code..after
View Tutorial          By: dhaval at 2011-01-03 03:42:28

5. I have one textbox and three label.i want to parse
View Tutorial          By: Nara at 2011-08-01 06:16:07

6. Ask to google.
View Tutorial          By: John at 2013-05-03 22:58:23

7. Thank you
View Tutorial          By: dara at 2009-12-19 02:46:52

8. abstract class A {
abstract void callme()

View Tutorial          By: satish at 2012-04-07 10:35:38

9. send me SMS RECEIVE code please
View Tutorial          By: Butler at 2008-04-26 05:33:40

10. Hi Rushabh, this only means that your port is not
View Tutorial          By: Ramlak at 2011-01-14 21:59:39