Page 1 of 1

Excel and FWH (Save As, Font Color, Cell shading)

Posted: Thu Apr 06, 2006 12:19 am
by cdmmaui
Hello,

I am using the great example provided by Milan and I need add the following functionality.

1) Perform Save As without dialog box
2) Change font color
3) Change cell shading

Can anyone help?

Sincerely,

Re: Excel and FWH (Save As, Font Color, Cell shading)

Posted: Thu Apr 06, 2006 11:13 am
by Enrico Maria Giordano
This is a working sample:

Code: Select all

FUNCTION MAIN()

    LOCAL oExcel := CREATEOBJECT( "Excel.Application" )

    LOCAL oWorkBook := oExcel:WorkBooks:Add()

    LOCAL oSheet := oExcel:ActiveSheet

    oSheet:Cells( 1, 1 ):Value = "This is a test"
    oSheet:Cells( 1, 1 ):Font:Color = 255
    oSheet:Cells( 1, 1 ):Interior:Color = 11184810
    oSheet:Cells( 1, 1 ):Font:Shadow = .T.

    oWorkBook:SaveAs( "c:\xharbour\newfile.xls" )

    oExcel:Quit()

    RETURN NIL
EMG

Posted: Thu Apr 06, 2006 3:17 pm
by cdmmaui
Thank you Enrico. Where can I find a table with the numerical values of the colors?

Sincerely,

Posted: Thu Apr 06, 2006 4:02 pm
by Enrico Maria Giordano
Paint, Colors, Modify colors, Custom colors. Then look at the three color numeric components.

EMG