Well one method i personally like an use a lot is this one
Imports System.Web
Imports System.IO
Private Sub CreateXLSFromDt(ByVal ds As DataSet, ByVal tablename As String,
ByVal location As String)
Dim grid As New System.Web.UI.WebControls.DataGrid
grid.HeaderStyle.Font.Bold = True
grid.DataSource = ds
grid.DataMember = tablename
grid.DataBind()
'// render the DataGrid control to a file
Using sw As New StreamWriter(location)
Using hw As New UI.HtmlTextWriter(sw)
grid.RenderControl(hw)
End Using
End Using
End Sub
usage
CreateXLSFromDt(dataset, TableNameInDataset , fullpath of file to create )
so in my situation
CreateXLSFromDt(dsBl, "tblBlok", "C:\testMp.xls") '
you just throw in a dataset and it will render the table data to a nicely
formated ( table with headers ) Excel sheet
Hope this works for you to
Michel
<za***@construction-imaging.comschreef in bericht
news:58**********************************@u10g2000 prn.googlegroups.com...
On Jan 28, 5:03 pm, "Michel Posseth [MCP]" <M...@posseth.comwrote:
Well you can write data files with a xls extension that will inmediatly be
converted by Excel when openned ( the user will not notice this )
this works for me ( office 2003 and higher )
if this might work for you i can show an example
I would like to see that please.
>
hth
Michel
<za...@construction-imaging.comschreef in
berichtnews:36**********************************@e 25g2000prg.googlegroups.com...
I have an application that can read an Excel spreadsheet on a computer
that doesn't have Excel installed on using the Jet ODBC 4.0 driver.
I know need to modify the application to also be able to create a new
Excel spreadsheet and write data to it on the same computer, a
computer that does not have Excel, or even Office installed.
I have done some research on this and it appears it cannot be done.
Can anyone verify that or better yet, point me to a link that explains
how to do it?