Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel Help
Message
 
 
À
05/12/2007 22:14:10
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Divers
Thread ID:
01273504
Message ID:
01273642
Vues:
10
This message has been marked as a message which has helped to the initial question of the thread.
>I'm trying to control Excel from VFP. I can make the change in Excel but I can't figure out how to get VFP to control Excel to do the same thing.
>
>I need to change the formatting of one column of a spreadsheet.
>
>I used the macro recorder which gave me the following code:
>
> Columns("P:P").Select
> With Selection
> .HorizontalAlignment = xlLeft
> .Orientation = 0
> .AddIndent = False
> .IndentLevel = 0
> .ShrinkToFit = False
> .ReadingOrder = xlContext
> End With
>
>How can I change this to execute as VFP code?
>Note: the object reference to the spreadsheet is: loActiveSheet
>
>I got this far:
>

Hi Chaim,

Try
with loActiveSheet.Range('P:P') && or loActiveSheet.Columns('P:P')
        .HorizontalAlignment = xlLeft
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
EndWith
Hopefully this would work, can not try it myself right now.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform