none
Ole DB Ungroup Sheets RRS feed

  • Question

  • There is a problem regarding create worksheets in Excel by using Ole DB.

    When I create 2 or more sheets by using Ole DB, the excel created contains GROUPED sheets.

    Is it possible to ungroup the work sheets by using Ole DB?

    The provider for the OleDbConnection is "Microsoft.ACE.OLEDB.12.0"

    • Moved by CoolDadTx Friday, July 22, 2016 1:40 PM Office related
    Friday, July 22, 2016 8:15 AM

Answers

  • >>>Is it possible to ungroup the work sheets by using Ole DB?

    According to your description, I agree with Kareninstructor that OleDb can't do ungrouping of sheets. 

    You could use VBA code to just select one sheet.

    If ActiveWindow.SelectedSheets.Count > 1 Then
       ActiveWindow.SelectedSheets(1).Select
    End If

    Or

    ActiveSheet.Select

    • Proposed as answer by David_JunFeng Tuesday, August 2, 2016 2:39 PM
    • Marked as answer by David_JunFeng Tuesday, August 2, 2016 2:39 PM
    Tuesday, July 26, 2016 6:42 AM

All replies

  • It is not possible to do anything more than you can do with a database so no, OleDb can't do ungrouping of sheets. You would need to use Excel automation, Open Office XML or a third party library.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Marked as answer by app.dev Friday, July 22, 2016 10:01 AM
    • Unmarked as answer by app.dev Friday, July 22, 2016 10:01 AM
    Friday, July 22, 2016 9:49 AM
  • >>>Is it possible to ungroup the work sheets by using Ole DB?

    According to your description, I agree with Kareninstructor that OleDb can't do ungrouping of sheets. 

    You could use VBA code to just select one sheet.

    If ActiveWindow.SelectedSheets.Count > 1 Then
       ActiveWindow.SelectedSheets(1).Select
    End If

    Or

    ActiveSheet.Select

    • Proposed as answer by David_JunFeng Tuesday, August 2, 2016 2:39 PM
    • Marked as answer by David_JunFeng Tuesday, August 2, 2016 2:39 PM
    Tuesday, July 26, 2016 6:42 AM