Automation - To set column width in Excel

Imre
Imre Member Posts: 10
Hello,

For example xlSheet.Range('A1').Font.Bold := TRUE; sets the font to Bold ....

How can I set the width of the column in excel ?
I can not find this object/property...

Is there any collection how can be handled excel objects/properties from Navision ?

Thanks in advance

Imre

Comments

  • Saalek
    Saalek Member Posts: 181
    Hi
    Try this

    xlSheet.Columns("B:B").ColumnWidth = 33.86


    Bye

    P.D.: To know wath are the method or properties used by excel, record a new Macro in Excel, do all actions in excel, and stop the macro. Then, go to this macro code (is VB) and you can see the code.
  • Tpe
    Tpe Member Posts: 1
    Hello!

    How can i set the columns autowidth?

    Köszi! (Thanks)
  • Luc_VanDyck
    Luc_VanDyck Member, Moderator, Administrator Posts: 3,633
    xlSheet.Range(CellNo).Columns.AutoFit;
    
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)