Excel 2007 PageSetup.FitToPagesWide problem
- by adopilot
For while I am trying to set Page Scaling of Excel page in Microsoft Visual Studio project for Excel2007 using C#
Code looks like
private void Sheet1_Startup(object sender, System.EventArgs e)
{
PageSetup.FitToPagesWide = 1;
PageSetup.FitToPagesTall = 1;
PageSetup.Orientation = Microsoft.Office.Interop.Excel.XlPageOrientation.xlLandscape;
PageSetup.PaperSize = Microsoft.Office.Interop.Excel.XlPaperSize.xlPaperA4;
}
Lines for PaperSise and Orientation are working well but, I can't make Excel to fit data to one page.
Am I doing something wrong ?
MSDN did not helped me much because they do not yet have a code sample for this language.