exporting to excel from vb.net application

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can someone post the needed code to help me export from my application to
excel? I have been trying to do this but I can't get it to work. Can some
give some documentation on this?
___
thanks rambo
 
I'm doing this from memory, but I think its something like this (add a
reference to Excel):

Dim xl as new Excel.Application
With xl
.workbooks.add "Template.xls"
.range("A1") = txtData.text
.range("A2") = txtMoreData.text
.range("A3") = "=sum(A1:A2"
.range("A3").Font.Bold = true
.save
.printOut
.quit 'Make sure you have this line or you'll end up with several
instances of Excel running
end with

HTH
 
¤ Can someone post the needed code to help me export from my application to
¤ excel? I have been trying to do this but I can't get it to work. Can some
¤ give some documentation on this?

See the following:

HOW TO: Transfer Data to an Excel Workbook by Using Visual Basic .NET
http://support.microsoft.com/kb/306022/


Paul
~~~~
Microsoft MVP (Visual Basic)
 
Back
Top