I am trying to determine if a cell in Microsoft excel contains a pivot table using Microsoft Interop C #
What I want to do is iterate over all the cells as indicated in the code below, and then if the cell contains a pivot table, I want to save the row and column information of that cell in an integer value as such
int rowCount = xlRange.Rows.Count;
int colCount = xlRange.Columns.Count;
Excel.Range cell = null;
for (int iRow = 1; iRow < rowCount; iRow++)
{
for (int iCol = 1; iCol <= colCount; iCol++)
{
cell = xlRange.Cells[iRow, iCol] as Excel.Range;
if()
{
int rowLocation = iRow;
int colLocation = iCol;
}
}
}
I tried looking at MSDN and other sources, but didn't seem to find any detection methods if the cell contains a pivot table.
Any help is appreciated, thanks.
source
share