Dear Ounis,
You still need to translate excel vba into vfp.
In your example you will have the following issues:
1. the value of the xl Constants.
You could know what they are by issuing "? xlDiagonalDown" in the excel Immediate (aka ^G) window
2. wherever Excel "assumes itself" in a definition, you will have to add your loExcel object variable. For example
range("A1:J1").select becomes loExcel.range("a1:j1").select
Please let me know if the solution I gave you earlier works, and if it does not what the error is.
Good luck and kind regards,
Marc
>Hello Mark,
>I was able to record a macro in excel I applied Bold and border line as you can see based on the code, but unfortunately I was unable to convert it to excel. here is the code, I have tried it and it give me lot of errors
>
>Range("A1:J1").Select
> Selection.Font.Bold = True
> Range("A1:J4").Select
> Selection.Borders(xlDiagonalDown).LineStyle = xlNone
> Selection.Borders(xlDiagonalUp).LineStyle = xlNone
> With Selection.Borders(xlEdgeLeft)
> .LineStyle = xlContinuous
> .ColorIndex = xlAutomatic
> .TintAndShade = 0
> .Weight = xlThin
> End With
> With Selection.Borders(xlEdgeTop)
> .LineStyle = xlContinuous
> .ColorIndex = xlAutomatic
> .TintAndShade = 0
> .Weight = xlThin
> End With
> With Selection.Borders(xlEdgeBottom)
> .LineStyle = xlContinuous
> .ColorIndex = xlAutomatic
> .TintAndShade = 0
> .Weight = xlThin
> End With
> With Selection.Borders(xlEdgeRight)
> .LineStyle = xlContinuous
> .ColorIndex = xlAutomatic
> .TintAndShade = 0
> .Weight = xlThin
> End With
> With Selection.Borders(xlInsideVertical)
> .LineStyle = xlContinuous
> .ColorIndex = xlAutomatic
> .TintAndShade = 0
> .Weight = xlThin
> End With
> With Selection.Borders(xlInsideHorizontal)
> .LineStyle = xlContinuous
> .ColorIndex = xlAutomatic
> .TintAndShade = 0
> .Weight = xlThin
> End With
>End Sub
If things have the tendency to go your way, do not worry. It won't last. Jules Renard.