Articles in this section
Category / Section

How can I set margins using XlsIO?

1 min read

The Margin option allows user to manipulate the size of the top, bottom, left and right margins and the size of the margins for the header and footer.


//Page Setup Using Margins
sheet.PageSetup.LeftMargin = 2;
sheet.PageSetup.RightMargin = 2;
sheet.PageSetup.TopMargin = 2;
sheet.PageSetup.BottomMargin = 2;


'Page Setup Using Margins
sheet.PageSetup.LeftMargin = 2
sheet.PageSetup.RightMargin = 2
sheet.PageSetup.TopMargin = 2
sheet.PageSetup.BottomMargin = 2

Here is the sample for your reference:

Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied