FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour EXCEL and interior color
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
EXCEL and interior color
Posted: Mon Jun 03, 2024 03:49 PM

The question is very simply

I want to colorize the cells interior using a color present in theme colors dialog.

In this way the user can manipulate an excel workshet using the same color i an easiste way

oAs:Range( "A1:K1" ):Interior:Color:= RGB( 244, 176 , 132 )

in my opinion an expression like this does not set a color present in theme colors dialog

oAs:Range( "A1:K1" ):Interior:Color:= Interior:ColorIndex := 40

Bye to all

Marco

Marco Boschi
info@marcoboschi.it
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: EXCEL and interior color
Posted: Mon Jun 03, 2024 04:44 PM
Look, pls.

https://fivewin.com.br/index.php?/topic/21673-usando-o-createobject-excelapplication/page/2/#comment-263150
Code (fw): Select all Collapse
/*
1-Black; 2-White; 5-Blue; 41-Light Blue; 11-Dark Blue; 10-Green; 3-Red; 6-Yellow; 53-Brown; 13-Violet; 46-Orange; 7-Pink
*/

oSheet:Cells(1,2):Font:ColorIndex := 1
oSheet:Cells(2,2):Interior:ColorIndex := 5

/*
1-Preto ; 2-Branco ; 5-Azul ; 41-Azul Claro ; 11-Azul Escuro ; 10-Verde ; 3-Vermelho ; 6-Amarelo ; 53-Marron ; 13-Violeta ; 46-Laranja ; 7-Rosa
*/
https://fivewin.com.br/index.php?/topic/21673-usando-o-createobject-excelapplication/

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: EXCEL and interior color
Posted: Mon Jun 03, 2024 05:48 PM

Use CHOOSECOLOR() function instead of a fixed RGB() color.

Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: EXCEL and interior color
Posted: Tue Jun 04, 2024 07:34 AM
hi,
The Interior:ColorIndex return otrher colors different from that of theme colors dialog.
Is there a list of that colors?
have a look here https://learn.microsoft.com/en-us/office/vba/api/excel.colorindex
Marco Boschi
info@marcoboschi.it
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: EXCEL and interior color
Posted: Tue Jun 04, 2024 07:38 AM

Ok, I don't know, sotty. Try to ask the AI.

Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: EXCEL and interior color
Posted: Tue Jun 04, 2024 07:46 AM
I refuse I'm sorry

:shock:
Marco Boschi
info@marcoboschi.it
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: EXCEL and interior color
Posted: Tue Jun 04, 2024 07:54 AM

Why? You can write in Italian.

Continue the discussion