Excel via COM - how to change color cell

Author: dammie@seznam.cz (dammie)

Hello,

I use excel via COM

signatures were generated by:

/sti /mwr=com /pid Excel.Application:EXCEL_


I use this code to fill cell with text:

newinstance "EXCEL_APPLICATION", $lh_excel$

$lh_excel$->set_visible(1)
$lh_excel$->get_workbooks($lh_workbooks$)
$lh_workbooks$->add($lh_workbook$,"")
$lh_excel$->get_range($lh_range$,"A1","A1")

$lh_range$->set_value2("text")

 


Question. How can I change color of this cell?

4 Comments

  1. Hi David

    Try this:

     

    $lh_excel$->get_range($lh_range$,"A1","A1")

    $lh_range$->get_interior($lh_interior$)

    $lh_interior$->set_colorindex(<color_index_number>)

     

    I did'nt check it. But I should/could work

    Ingo


    Author: istiller (i2stiller@gmx.de)
  2. Many thanks...

    Excuse one more question...

    I am trying change font to bold via set_bold but it doesnt works

     $lh_range$->get_font($lh_font$)

     $lh_font$->set_bold(1)

     it works if I use

     $lh_font$->set_fontstyle("Bold")

     Whats problem?


    Author: dammie (dammie@seznam.cz)
  3. Hello

    check the signature possible the excel has transform the boolean to long...

    i use Bold.set literal name with one parameter IN:Boolean

    and it works fine

    John

     

     


    Author: jtsagara (jtsagara@logisoft.gr)
  4. Thanks. Changed to boolean and it works...


    Author: dammie (dammie@seznam.cz)