Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel Automation Question
Message
 
To
07/01/2011 23:22:41
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows NT
Network:
Windows NT
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01495220
Message ID:
01495222
Views:
72
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform