Alaska Software Inc. - ActiveX for put color in cells of excel.
Username: Password:
AuthorTopic: ActiveX for put color in cells of excel.
CESAR CALVOActiveX for put color in cells of excel.
on Wed, 20 Jan 2016 22:14:43 +0100
Hello friends.
I am trying to do the macro you can see below but I don´t know.
Could snybody help me?
Regards.
César.


The macro
Cells.Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
    Formula1:="=""no"""
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
    .Color = -16383844
    .TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
    .PatternColorIndex = xlAutomatic
    .Color = 13551615
    .TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
Range("A1").Select



Source Code?

cFil := ::cDir + "UTES_PORTAL_TESORERIA.xlsx"

oExcel := CreateObject( "EXCEL.APPLICATION" )

oBook := oExcel:workbooks:open(cFIL)

oExcel:Visible := .F.
oExcel:DisplayAlerts := .F.

oSheet := oExcel:Worksheets("COMPARATIVA_DISTRIBUCION")

oExcel:Cells:Select()

//-------------------------------------------------------------------------------------------------//


And the rest I don´t how ........................






//-------------------------------------------------------------------------------------------------//

oExcel:ActiveWorkbook:Save()

oExcel:ActiveWorkbook:Close()

oExcel:Quit()
oExcel:Destroy()
Jose Antonio Diego KerejeRe: ActiveX for put color in cells of excel.
on Thu, 21 Jan 2016 00:45:13 +0100
Regards. Diego


Test.zip
CESAR CALVORe: ActiveX for put color in cells of excel.
on Thu, 21 Jan 2016 07:07:03 +0100
Many thanks Diego.

"Jose Antonio Diego Kereje" escribió en el mensaje de 
noticias:428f8217$20664704$44a42@news.alaska-software.com...

Regards. Diego
CESAR CALVORe: ActiveX for put color in cells of excel.
on Fri, 22 Jan 2016 21:13:38 +0100
I got it with this, Alaska Team help me for to understand how works VBA and 
the way to translate this to XBase.

oExcel := CreateObject( "EXCEL.APPLICATION" )

oBook := oExcel:workbooks:open(cFIL)

oExcel:Visible := .F.
oExcel:DisplayAlerts := .F.

oSheet := oExcel:Worksheets("COMPARATIVA_DISTRIBUCION")

FOR C = 1 TO Len(aHoj)
   oSheet:Columns(C+2):Select()
   oExcel:Selection:TextToColumns
NEXT


oExcel:ActiveWorkbook:Save()

oSheet:Cells(1,1):Select()

oSheet:Range("C2:M418"):Select

oExcel:Selection:FormatConditions:Add( xlCellValue,xlEqual,"no")
oExcel:Selection:FormatConditions(1):Font:Color := -16383844
oExcel:Selection:FormatConditions(1):Font:TintAndShade := 0
oExcel:Selection:FormatConditions(1):Interior:Color := 13551615

oSheet:Cells(1,1):Select

oExcel:ActiveWorkbook:Save()

oExcel:ActiveWorkbook:Close()

oExcel:Quit()
oExcel:Destroy()

Really very good.

Thanks Alaska Software.

"Jose Antonio Diego Kereje" escribió en el mensaje de 
noticias:428f8217$20664704$44a42@news.alaska-software.com...

Regards. Diego