Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Excel AddCode in worksheet
#2
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     Help - how to add the trigger to the macro
Code:
Copy      Help
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


Messages In This Thread
Excel AddCode in worksheet - by Lucas - 05-04-2018, 07:11 PM
RE: Excel AddCode in worksheet - by Lucas - 05-07-2018, 06:06 AM
RE: Excel AddCode in worksheet - by Gintaras - 05-07-2018, 05:17 PM
RE: Excel AddCode in worksheet - by Lucas - 05-07-2018, 07:12 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)