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. Hi! I'm working on Ubuntu 10.04

At

View Tutorial          By: Rushabh at 2011-01-12 06:22:43

2. Hi,
I want to run a bat file, below are the

View Tutorial          By: Rajshekar at 2011-10-28 06:07:06

3. hi .the program does run thank you for that ,i nee
View Tutorial          By: mazen at 2008-09-09 04:55:16

4. HI all,

I am not able to call SMSC

View Tutorial          By: chinnadurai at 2009-08-26 23:58:54

5. The following exception are raised in send sms in
View Tutorial          By: Vikram Subbiah at 2010-04-12 02:09:36

6. what we have to write in simple comparator class
View Tutorial          By: shiva at 2015-04-18 09:19:17

7. this is good, but i need a simple program about sh
View Tutorial          By: ramalakshmi at 2011-01-05 03:38:26

8. Excelent article, I will start to use struts 2 now
View Tutorial          By: Alex at 2010-01-20 16:13:34

9. good one !
View Tutorial          By: qasim at 2008-05-18 03:16:55

10. thank u sir ,this helped a lot
************

View Tutorial          By: yugandharr at 2012-09-11 15:47:19