EXCEL and interior color

EXCEL and interior color

Postby MarcoBoschi » Mon Jun 03, 2024 3: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
User avatar
MarcoBoschi
 
Posts: 1056
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: EXCEL and interior color

Postby karinha » Mon Jun 03, 2024 4:44 pm

Look, pls.

https://fivewin.com.br/index.php?/topic/21673-usando-o-createobject-excelapplication/page/2/#comment-263150

Code: Select all  Expand view

/*
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
User avatar
karinha
 
Posts: 7643
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: EXCEL and interior color

Postby Enrico Maria Giordano » Mon Jun 03, 2024 5:48 pm

Use CHOOSECOLOR() function instead of a fixed RGB() color.
User avatar
Enrico Maria Giordano
 
Posts: 8570
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: EXCEL and interior color

Postby MarcoBoschi » Tue Jun 04, 2024 7: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/offic ... colorindex
User avatar
MarcoBoschi
 
Posts: 1056
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: EXCEL and interior color

Postby Enrico Maria Giordano » Tue Jun 04, 2024 7:38 am

Ok, I don't know, sotty. Try to ask the AI.
User avatar
Enrico Maria Giordano
 
Posts: 8570
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: EXCEL and interior color

Postby MarcoBoschi » Tue Jun 04, 2024 7:46 am

I refuse I'm sorry

:shock:
User avatar
MarcoBoschi
 
Posts: 1056
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: EXCEL and interior color

Postby Enrico Maria Giordano » Tue Jun 04, 2024 7:54 am

Why? You can write in Italian.
User avatar
Enrico Maria Giordano
 
Posts: 8570
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 49 guests