Output ASP tables to Excel and creat seperate worksheets

I have an ASP web page that creates 3 tables from a SQL data base.  I am abel to export the tables to Excel using the following code:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Response.Clear()
        Response.Buffer = True
        Response.ContentType = "application/vnd.ms-excel"

        Response.Charset = ""

        Dim oStringWriter As System.IO.StringWriter = New System.IO.StringWriter
        Dim oHtmlTextWriter As System.Web.UI.HtmlTextWriter = New System.Web.UI.HtmlTextWriter(oStringWriter)

        tb2.RenderControl(oHtmlTextWriter)
        lbl1.RenderControl(oHtmlTextWriter)
        tb3.RenderControl(oHtmlTextWriter)
        lbl2.RenderControl(oHtmlTextWriter)
        tb4.RenderControl(oHtmlTextWriter)
        lbl3.RenderControl(oHtmlTextWriter)
        tb5.RenderControl(oHtmlTextWriter)
        Response.Write(oStringWriter.ToString())

        Response.End()

    End Sub


Each table is seperated by a label and all three tables are on one worksheet.

I would like to creat a seperate worksheet in the Excel workbook for each table. How can this be done?

Thanks.

Ira
inewmanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

thefritterfatboyCommented:
Personally, I'd use SpreadSheetML - Not HTML to create Excel documents.

It takes some getting used to but it's much more accurate:

http://ewbi.blogs.com/develops/2005/01/create_excels_s.html
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.