I am having some problems in getting landscape property from an opened Excel worksheet.
CREATE(xlApp);
xlApp.Workbooks.Open('FileName.xls');
xlWorkBook := xlApp.ActiveWorkbook;
xlWorkSheet := xlWorkBook.Worksheets.Item(1);
message(format(xlWorkSheet.PageSetup.Orientation));
When the code above is executed, it pops up with the message of 64. But the valid selection for pagesetup according to excel documentation is 1 for Portrait and 2 for Landscape. Can any provide any explanation for the above?
I also tried with some other page setup property, and I also get the value 64 or 65. But not the actual documented values in Excel.
Comments
http://www.archerpoint.com/blog/faithie-robertson
A blog by Faithie Robertson
Yes. I can set a sheet to landscape. But what I want to do, is to open an excel sheet, and determine whether the sheet is in landscape or in portrait and this is what i am not able to do. what i want to achieve, is to read the landscape or portrait setting in an excel sheet.