Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OLE automation question
Message
De
05/08/1999 16:30:56
 
 
À
05/08/1999 16:05:34
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00250316
Message ID:
00250406
Vues:
50
>Here is the VBA code from the macro recording:
>
> Range("A1").Select
> With Selection
> .HorizontalAlignment = xlCenter
> .VerticalAlignment = xlBottom
> .WrapText = False
> .Orientation = 0
> .ShrinkToFit = False
> .MergeCells = False
>
>I changed it to:
>
> OleApp.Range("A1").Select
> With OleApp.Selection
> .HorizontalAlignment = xlCenter
> .VerticalAlignment = xlBottom
> .WrapText = False
> .Orientation = 0
> .ShrinkToFit = False
> .MergeCells = False
> endwith
>
>but when I run it, i get a message that the variable xlCenter can't be found
>
>I have also tried putting xlCenter in quotes and i got a very arcane message -
>OLE ldispatch exception code 1004 from Excel:unable to set the HorizontalAlignment property of the Range class....
>
>in the excel help file for VBA it says that the HorizontalAlignment property "applies to" the Range object
>
>Hope this clarifies the problem some

You have to include an excel.h file with all these constants defined.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform