In this article, you will learn how to set the margins of an Excel worksheet using sample code. You will also learn how to programmatically set the margins for the page centre, the Header and footer margins of Page Setup using the C# API or .NET Library.... Header and Footer Margins Set header and footer margins...Setting Page Options Setting Headers and Footers...