locked
reading sheets from an excel file RRS feed

  • Question

  • User-1305073333 posted

    Hi, i use :

    System.Data.DataTable SheetList = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, new object[] { null, null, null, "TABLE" });

    to get sheets of an excel file.

    The problem is that when i insert a filter on a column i get two sheets, one is the oringal sheet, the second is the original sheet plus the name of the filter i applied on the sheet.

    I loop on  sheetList.Rows[i][2] to get the names of all the sheets.

    Is there any way to avoid this doubled sheet names?

    Thank you.

    Thursday, September 29, 2011 11:44 AM

Answers

  • User-1305073333 posted

    I realised that when importing a closed excel file i get other than the sheet name even sheet name +_, when the excel file is already opened in  excel i get sheet name+_filterDatabase.

    Thanks

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, September 30, 2011 4:28 AM

All replies

  • User-1305073333 posted

    I realised that when importing a closed excel file i get other than the sheet name even sheet name +_, when the excel file is already opened in  excel i get sheet name+_filterDatabase.

    Thanks

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, September 30, 2011 4:28 AM
  • User3866881 posted

    Hello armal1981:)

    So that's the most difference between Open and Close to an Excel file.

    It seems that you've realized and there's nothing wrong with your app....

    Congratualations!

    And welcome your feedback again.

     

    Friday, September 30, 2011 8:45 PM