I am looping through all the worksheets in a excel document. The document in question has headers on every sheet but half of the worksheets are of made from a chart template.
The outer loop, loops through all worksheets (chart sheets as well), and the pagesetup.getheader returns a value for the normal worksheets, but the pagesetup.getheader only returns a null on the chart type worksheets.
Am I doing somthing wrong? Or does Pagesetup.getheader not work on worksheets created from a graph template.
The code in question:
for (j = 0; j < wbook.Worksheets.Count; j++)
for (i = 0; i < 3; i++)
if (wbook.Worksheets[j].PageSetup.GetHeader(i) != null)
stringHeader = wbook.Worksheets[j].PageSetup.GetHeader(i).ToString();