Set Margins In Excel Using Excel Interop VB.Net

2019-08-04 06:11发布

Anyone have code to set margins(top,left,right,bottom) using excel interop and vb.net. I think it must be part of the worksheet object but maybe the workbook object. Having a tough time finding an example. Thanks in advance.

标签: c# vb.net excel
2条回答
看我几分像从前
2楼-- · 2019-08-04 06:39

I found it its part of the worksheet object...

i.e.

xlWorkSheet.PageSetup.TopMargin=0.5

查看更多
趁早两清
3楼-- · 2019-08-04 06:46

Margins are set through the PageSetup object which you get from on the WorkSheet.PageSetup property.

查看更多
登录 后发表回答