Question about FWH and Excel

Question about FWH and Excel

Postby driessen » Thu Sep 24, 2020 9:05 am

Hello,

Can someone tell me how I can change a backgroundcolor of a field in an Excel file from my FWH-application?

Thank you.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.02 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc77
User avatar
driessen
 
Posts: 1399
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Question about FWH and Excel

Postby ADutheil » Thu Sep 24, 2020 10:43 am

Try this
oSheet:Range( oSheet:Cells( 1, 1 ), oSheet:Cells( 1, 7 ) ):Interior:ColorIndex := Violeta
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: Question about FWH and Excel

Postby driessen » Thu Sep 24, 2020 10:45 am

Thanks for your suggestion.

Where do I find the information how to build such FWH-code to control Excel?

Can I use RGB-codes?
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.02 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc77
User avatar
driessen
 
Posts: 1399
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Question about FWH and Excel

Postby ADutheil » Thu Sep 24, 2020 3:43 pm

Anytime I need something new I search Excel VBA examples and adapt them to FWH. As for RGB colors I don't know. Check below.

https://www.automateexcel.com/excel-formatting/color-reference-for-color-index/
Regards,

André Dutheil
FWH 13.04 + HB 3.2 + MSVS 10
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: Question about FWH and Excel

Postby driessen » Thu Sep 24, 2020 3:57 pm

And how do you adapt vrom VBA to FWH?
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.02 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc77
User avatar
driessen
 
Posts: 1399
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Question about FWH and Excel

Postby ADutheil » Fri Sep 25, 2020 12:55 pm

I don't have a recipe but there are a lot of similarities: VAB Cells(x, y).Interior.ColorIndex <-> FWH Cells(x, y):Interior:ColorIndex.
Regards,

André Dutheil
FWH 13.04 + HB 3.2 + MSVS 10
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: Question about FWH and Excel

Postby driessen » Fri Sep 25, 2020 1:45 pm

And please, can you tell me how to add a sheet in an Excel-document?
And can you tell me how to change the name of the sheet?
Thanks.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.02 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc77
User avatar
driessen
 
Posts: 1399
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Question about FWH and Excel

Postby ADutheil » Fri Sep 25, 2020 4:11 pm

Code: Select all  Expand view

oExcel := win_oleCreateObject( "Excel.Application" )
oWorkb := oExcel:WorkBooks:Add()
oSheet := oWorkb:Sheets( number of the sheet you want to work with 1 2 3... )
oSheet:Name := "the name you want for your sheet"
 


PM me your mail I'll send you a code you can use to learn more about VBA methods and properties.
Regards,

André Dutheil
FWH 13.04 + HB 3.2 + MSVS 10
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: Question about FWH and Excel

Postby hua » Mon Sep 28, 2020 4:21 am

FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1050
Joined: Fri Oct 28, 2005 2:27 am

Re: Question about FWH and Excel

Postby driessen » Mon Sep 28, 2020 7:29 am

Thank you all very much.
I found a answer to all my question, thanks to your help.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.02 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc77
User avatar
driessen
 
Posts: 1399
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], Otto and 38 guests