U
Ugo
Hi,
Can anyone help? I am creating an Excel file in asp.net and when
I set the PageSetup.Orientation I get the following error.
Unable to set the Orientation property of the PageSetup class
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: Unable to
set the Orientation property of the PageSetup class
oXL = new Excel.Application();
oXL.Visible = false;
//Get a new workbook.
oWB = (Excel._Workbook)(oXL.Workbooks.Add( Missing.Value ));
oSheet = (Excel._Worksheet)oWB.ActiveSheet;
oSheet.PageSetup.Orientation= Excel.XlPageOrientation.xlLandscape;
oSheet.PageSetup.PaperSize = Excel.XlPaperSize.xlPaperLegal;
Thanks,
Ugo
Can anyone help? I am creating an Excel file in asp.net and when
I set the PageSetup.Orientation I get the following error.
Unable to set the Orientation property of the PageSetup class
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: Unable to
set the Orientation property of the PageSetup class
oXL = new Excel.Application();
oXL.Visible = false;
//Get a new workbook.
oWB = (Excel._Workbook)(oXL.Workbooks.Add( Missing.Value ));
oSheet = (Excel._Worksheet)oWB.ActiveSheet;
oSheet.PageSetup.Orientation= Excel.XlPageOrientation.xlLandscape;
oSheet.PageSetup.PaperSize = Excel.XlPaperSize.xlPaperLegal;
Thanks,
Ugo