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 work ;)
View Tutorial          By: Rizwanulla Sharieff at 2012-08-21 04:42:41

2. Nice guidelines which provide to understand struts
View Tutorial          By: harshal patel at 2010-08-13 04:59:16

3. Your explanation and example for toString() is gre
View Tutorial          By: Dinesh at 2012-10-19 08:29:13

4. Excellent information reg the scopes of jsp , plea
View Tutorial          By: venkateshwarreddy suravaram at 2012-01-09 08:34:23

5. help
View Tutorial          By: sne at 2012-08-10 07:13:28

6. Using ForwardAction for Integration is Good, Which
View Tutorial          By: Ramesh Ram at 2013-06-05 17:57:25

7. HI, Thanks for your beautiful tutorial.

View Tutorial          By: Chintan at 2011-10-06 07:35:01

8. Hi all
Can you please tell ,how to recei

View Tutorial          By: Nanthini at 2011-09-07 16:48:04

9. can u give video of this code how it work & w
View Tutorial          By: vishal mande at 2015-04-04 08:20:30

10. examples are very use full
View Tutorial          By: keerthe at 2010-08-12 23:00:21