//set header text s1.Header.Left = HSSFHeader.Page; //Page is a static property of HSSFHeader and HSSFFooter s1.Header.Center = "This is a test sheet"; //set footer text s1.Footer.Left = "Copyright Nissl Lab"; s1.Footer.Right = "created by NPOI team"; using (FileStream sw = File.Create("test.xlsx")) { workbook.Write(sw); } } } }