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. great explanations.. some important words are miss
View Tutorial          By: Joshua Paul at 2015-04-14 03:43:44

2. Rattling explanation .....thnx brother
View Tutorial          By: zorro at 2011-06-16 05:05:43

3. how this program is work , please, tell
View Tutorial          By: rohit kumar at 2015-10-30 12:22:05

4. what ll be result for s1==s2 and s1.equals(s2) for
View Tutorial          By: vijay at 2011-08-21 15:09:41

5. thankyou Mr Ramlak for your help but please can yo
View Tutorial          By: yash at 2008-05-12 16:46:18

6. im trying to just store the data taken from editex
View Tutorial          By: praveen at 2014-08-05 15:19:51

7. Respected sir,
I am trying to embed windows

View Tutorial          By: arshad at 2011-10-22 17:05:21

8. In case your having trouble

1 the a

View Tutorial          By: Sin at 2013-01-17 05:40:37

9. You have clear my confusion by using simple codes!
View Tutorial          By: salahu.kt at 2010-09-28 07:33:55

10. This is a cool tutorial ! :) But I think in this s
View Tutorial          By: ngocanh at 2013-07-11 02:33:06