Excel automation

maikeljmaikelj Member Posts: 50
edited 2003-03-06 in Navision Financials
Hi there,

Does anybody know how I can turn the page orientation around in Excel?
From landscape to portrait and vice versa.

MaikelJ

Comments

  • maikeljmaikelj Member Posts: 50
    I've already found the solution:

    xlSheet.PageSetup.Orientation := 2; //Landscape
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    You can use this code:
    fctOrientationLandscape(pblnLandscape : Boolean)
    //fctOrientationLandscape
    // PARAMETERS:
    //   pblnLandscape
    //   RETURN-VALUE: none
    // EXAMPLE: fctOrientationLandscape(TRUE);
    
    IF pblnLandscape THEN
      autExcelWorksheet.PageSetup.Orientation(2)
    ELSE
      autExcelWorksheet.PageSetup.Orientation(1);
    
    where autExcelWorksheet is an Automation variable with Subtype: 'Microsoft Excel 9.0 Object Library'.Worksheet
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • maikeljmaikelj Member Posts: 50
    Thanks for the code Luc, but I already solved the problem.

    MaikelJ
Sign In or Register to comment.