Title: how to retrieve a list of sheet from excel with odbc in c#?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Laurent Liegeois

    Title: how to retrieve a list of sheet from excel with odbc in c#?

    I have a document in excel with several sheets, But I would like to
    build a listbox with the lis
    -=zoltux=-

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
  • William Ryan

    #2
    Title: how to retrieve a list of sheet from excel with odbc in c#?

    You can enumerate the Worksheets collection grabbing the
    name of each sheet....

    for each worksheet in workbook
    someList.Items. Add(worksheet.n ame);//It might be
    activesheet,I haven't done it in a while.
    next

    I don't know how far you have gotten in your code, I'm
    assuming you already have the Excel 9.0 reference set and
    have created your workbook. If you only need to do this
    once to an existing book, just open it and run through the
    sheets collection as mentioned above.

    let me know if you have any problems.

    Bill

    W.G. Ryan[color=blue]
    >-----Original Message-----
    >I have a document in excel with several sheets, But I[/color]
    would like to[color=blue]
    >build a listbox with the lis
    >-=zoltux=-
    >
    >*** Sent via Developersdex http://www.developersdex.com[/color]
    ***[color=blue]
    >Don't just participate in USENET...get rewarded for it!
    >.
    >[/color]

    Comment

    Working...