L
ldiowa
Hi There,
I am struggle with .set_SubTotals using C#:
I tried:
object[] noSub = { false, false, false, false, false, false, false, false, false, false, false, false };
Excel.PivotTable pt = XlApp.ActiveSheet.PivotTable("Test");
pt.PivotFields("Datestamp").set_Subtotals(Type.Missing, noSub);
and
pt.PivotFields("Datestamp").set_Subtotals(noSub, Type.Missing);
and
for (int index = 1; index <= 12; index++)
{
pt.PivotFields("Test").set_Subtotals(index, false);
}
In all three cases, the error message popped up and saying "'System.__ComObject' does not contain a definition for 'set_Subtotals'".
I am new to Excel programing and appreciate your help.
Hugh
I am struggle with .set_SubTotals using C#:
I tried:
object[] noSub = { false, false, false, false, false, false, false, false, false, false, false, false };
Excel.PivotTable pt = XlApp.ActiveSheet.PivotTable("Test");
pt.PivotFields("Datestamp").set_Subtotals(Type.Missing, noSub);
and
pt.PivotFields("Datestamp").set_Subtotals(noSub, Type.Missing);
and
for (int index = 1; index <= 12; index++)
{
pt.PivotFields("Test").set_Subtotals(index, false);
}
In all three cases, the error message popped up and saying "'System.__ComObject' does not contain a definition for 'set_Subtotals'".
I am new to Excel programing and appreciate your help.
Hugh