format the cells while export to exces

suresh111suresh111 Member Posts: 32
edited 2005-03-15 in Navision Attain
Hi
can any one help me to format the cells in the excel sheets, when we create a excel sheet through a report. I am not able to format the cell as date and text etc.,

suresh

Comments

  • keiahkeiah Member Posts: 9
    Hi Suresh,

    do you want to export via ExcelBuffer or directly via Excel automation objects?

    Greetings
    Kai
    Kai Huegle
    from mack-rides.com
  • suresh111suresh111 Member Posts: 32
    yes, it is through automation objects

    suresh
  • keiahkeiah Member Posts: 9
    Hi Suresh,

    you will find many information about this in table 370 (Excel Buffer) in the code sections.

    You have to adress the excel object properties as you use it in visualbasic (opt. vba). But you have to use the codenumbers not the excel expressions (use f.e. -4131 instead of xlHAlignLeft to align horizontal).

    Greetings from the black forest
    Kai

    Some examples:
    (you will find the numbers to use in the object catalog of excel vba editor)

    XlWorkSheet.Range(xlColID + xlRowID).NumberFormat := NumberFormat;
    XlWorkSheet.Range(xlColID + xlRowID).Value := "Cell Value as Text"
    XlWorkSheet.Range(xlColID + xlRowID).Formula := Formula;
    XlWorkSheet.Range(xlColID + xlRowID).AddComment := Comment;
    XlWorkSheet.Range(xlColID + xlRowID).Font.Bold := Bold;
    XlWorkSheet.Range(xlColID + xlRowID).Font.Italic := Italic;
    XlWorkSheet.Range(xlColID + xlRowID).Borders.LineStyle := XlLineStyleNone;
    Kai Huegle
    from mack-rides.com
Sign In or Register to comment.