Not able to set the page properties of an excel sheet

189 views Asked by At

i am not able to set the sheet properties of an excel workbook using c# code. her is the code.

sheet.PageSetup.PaperSize = XlPaperSize.xlPaperA4;                        
sheet.PageSetup.Zoom = false;
sheet.PageSetup.FitToPagesWide = 1;

for eg even after the first line of execution the papersize is Xlpaperletter.

This is working fine in my friend's machine. is this because of some default property present in Microsoft excel which is blocking me to set these properties. I am using interop dlls.

Please help. Thanks in advance

0

There are 0 answers