GroupDocsGists
10/19/2017 - 11:06 AM

ClearHeaderFooterExcel.cs

// For complete examples and data files, please go to https://github.com/groupdocs-watermark/GroupDocs.Watermark-for-.NET
using (CellsDocument doc = Document.Load<CellsDocument>(Utilities.MapSourceFilePath (FilePath)))
{
    foreach (CellsHeaderFooterSection section in doc.Worksheets[0].HeadersFooters[OfficeHeaderFooterType.HeaderPrimary].Sections)
    {
        section.Script = null;
        section.Image = null;
    }
    doc.Save();
}