Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel Automation Question
Message
 
À
07/01/2011 23:22:41
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows NT
Network:
Windows NT
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01495220
Message ID:
01495222
Vues:
73
>I have very limited experience with Office Excel Automation and would like some help.
>
>How do you change a complete column's alignment to LEFT justified, CENTER or RIGHT justified?
>
>Thanks,
>Robert Wright
#define xlLeft   -4131
#define xlRight  -4152
#define xlCenter -4108

LOCAL oExcel AS Excel.Application
oExcel = CREATEOBJECT("Excel.Application")
*oExcel.Workbooks.Open("FullPathToYourExcelFileHere")

oExcel.Workbooks.Add()
oExcel.Visible = .t.

oExcel.Columns("A:A").Select
oExcel.Selection.HorizontalAlignment = xlLeft

oExcel.Columns("B:B").Select
oExcel.Selection.HorizontalAlignment = xlRight

oExcel.Columns("C:C").Select
oExcel.Selection.HorizontalAlignment = xlCenter
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform