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. very good example...........
View Tutorial          By: debojit dey at 2010-07-20 15:48:38

2. i want to Java coding's immediately
View Tutorial          By: vignesh at 2009-07-29 07:02:23

3. XML Parsing - Simplified.
Thanks.

View Tutorial          By: Piyush at 2011-05-19 22:56:23

4. It was actually useful!!! Thanks for explaining in
View Tutorial          By: steph at 2010-01-28 21:59:06

5. good and nice
View Tutorial          By: Elayaraja j at 2011-06-18 05:30:07

6. i din understand
View Tutorial          By: panda at 2011-07-14 09:35:36

7. for ex

public class test()
{

View Tutorial          By: Anundhara at 2012-08-11 06:54:57

8. Hello, I have executed the above code and it works
View Tutorial          By: Sana at 2010-02-01 03:49:44

9. give me the code
View Tutorial          By: roger at 2013-10-10 19:44:07

10. i get this error too.
: Parent: child proce

View Tutorial          By: Anon at 2009-02-25 08:30:58