05-07-2018, 06:06 AM
Another way...
Can you help me to convert:
s.FormatConditions.Item(1).Borders.Item(Excel.xlDiagonalDown).LineStyle = Excel.xlNone
Error (RT) in <open ":1320: /252">highligh_cell_cross_excel: 0x80020009, Ocurrió una excepción.
0x3EC, No se puede asignar la propiedad LineStyle de la clase Border. <help #IDP_ERR>?
Function highligh_cell_cross_excel
Trigger CSAi
Can you help me to convert:
s.FormatConditions.Item(1).Borders.Item(Excel.xlDiagonalDown).LineStyle = Excel.xlNone
Error (RT) in <open ":1320: /252">highligh_cell_cross_excel: 0x80020009, Ocurrió una excepción.
0x3EC, No se puede asignar la propiedad LineStyle de la clase Border. <help #IDP_ERR>?
Function highligh_cell_cross_excel
Trigger CSAi
ExcelSheet a.Init
Excel.Range s=a.ws.Range("1:100")
s.FormatConditions.Delete
s.FormatConditions.Add(Excel.xlExpression 0 "=Y(CELDA(''col'')=CELDA(''col'';A1);CELDA(''row'')>CELDA(''row'';A1))")
s.FormatConditions.Item(1).Borders.Item(Excel.xlDiagonalDown).LineStyle = Excel.xlNone
;s.FormatConditions.Item(1).Borders(Excel.xlDiagonalUp).LineStyle = Excel.xlNone
s.FormatConditions.Add(Excel.xlExpression 0 "=Y(CELDA(''row'')=CELDA(''row'';A1);CELDA(''col'')>CELDA(''col'';A1))")
s.Calculate
;;;;Selection.Borders(xlDiagonalDown).LineStyle = xlNone
;;;;;Selection.Borders(xlDiagonalUp).LineStyle = xlNone
;;;;;With Selection.Borders(xlEdgeLeft)
;;;;;;;;;.LineStyle = xlContinuous
;;;;;;;;;.Color = -11489280
;;;;;;;;;.TintAndShade = 0
;;;;;;;;;.Weight = xlThin
;;;;;End With
;;;;;Selection.Borders(xlEdgeTop).LineStyle = xlNone
;;;;;Selection.Borders(xlEdgeBottom).LineStyle = xlNone
;;;;;With Selection.Borders(xlEdgeRight)
;;;;;;;;;.LineStyle = xlContinuous
;;;;;;;;;.Color = -11489280
;;;;;;;;;.TintAndShade = 0
;;;;;;;;;.Weight = xlThin
;;;;;End With
;;;;;Selection.Borders(xlInsideVertical).LineStyle = xlNone
;;;;;Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
;End Sub