Text Format in Export to Excel

navuser1navuser1 Member Posts: 1,329
Dear All,

Using Excel Automation I'm exporting data into Excel,But my data comes 10001 instead of 0000010001.
What to do ?
Now or Never

Comments

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Export your data as '0000010001 (with a apostrophe in front of the field).
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • navuser1navuser1 Member Posts: 1,329
    Export your data as '0000010001 (with a apostrophe in front of the field).
    My C/AL code is :
    XlWrkSht.Range(A).Value := Item."No.";
    
    Now or Never
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Thx for sharing.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • crisnicolascrisnicolas Member Posts: 177
    If you use the Excel Buffer table, you could assign '@' to FormatNumber field.
    This will export your data with format Text instead of the default General.
Sign In or Register to comment.