Hi All,
I am running some Excel code within Access after exporting to excel using the code below. All is ok except at the line...
xlApp.Selection.Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Array(5), Replace:=True, PageBreaks:=False, SummaryBelowData:=False
I am not sure what other changes need to be made to this Excel code besides the addition of xlApp. at the start. This usually works fine as per below however it will not work with this line. If I remove this line the code below works without a problem.
-----------------------------------------------------------------------
Dim xlApp As Object
xlApp.Cells.Select
xlApp.Selection.Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Array(5), Replace:=True, PageBreaks:=False, SummaryBelowData:=False
xlApp.ActiveSheet.Outline.ShowLevels RowLevels:=2
xlApp.Range("F1").Select
xlApp.Visible = True
------------------------------------------------------------------------
Thanks
I am running some Excel code within Access after exporting to excel using the code below. All is ok except at the line...
xlApp.Selection.Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Array(5), Replace:=True, PageBreaks:=False, SummaryBelowData:=False
I am not sure what other changes need to be made to this Excel code besides the addition of xlApp. at the start. This usually works fine as per below however it will not work with this line. If I remove this line the code below works without a problem.
-----------------------------------------------------------------------
Dim xlApp As Object
xlApp.Cells.Select
xlApp.Selection.Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Array(5), Replace:=True, PageBreaks:=False, SummaryBelowData:=False
xlApp.ActiveSheet.Outline.ShowLevels RowLevels:=2
xlApp.Range("F1").Select
xlApp.Visible = True
------------------------------------------------------------------------
Thanks