Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Border and line with excel
Message
 
À
21/10/2011 00:27:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01526984
Message ID:
01527028
Vues:
46
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform