Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Formating Excel
Message
From
01/08/2005 04:28:01
 
 
To
01/08/2005 04:00:17
Albert Beermann
Piepenbrock Service Gmbh & Cokg
Osnabrück, Germany
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Environment versions
Visual FoxPro:
VFP 8 SP1
Database:
MySQL
Miscellaneous
Thread ID:
01037409
Message ID:
01037413
Views:
25
>Hello everybody
>
>I create an excel.sheet and put some data into the cells
>oleApp = CREATEOBJECT("Excel.Application")
>OleApp.Visible=.T.
>OleApp.Workbooks.Add
>OleApp.Cells(1,1).Value=
>OleApp.Cells(1,2).Value=
>
>..........
>Now i want to format the cells (alignment right and optimal column width)
>(i get the code from recording a macro)
>
> OleApp.Range("A:AZ").Select
> With oleapp.Selection
> .HorizontalAlignment = 'xlRight'
> .VerticalAlignment = 'xlBottom'
> .WrapText = .F.
> .Orientation = 0
> .AddIndent = .F.
> .IndentLevel = 0
> .ShrinkToFit = .F.
> .ReadingOrder = 'xlContext'
> .MergeCells = .F.
> .Columns.AutoFit
> EndWith
>OleApp.Range("A1").Select
>
>error:
>horizontal alignmennt property can't be set !!
>same to vertical alignment and readingorder
>
>What am i missing ???????
>
>Any help welcomed
>Best regards
>Albert

Albert,

You are using defined constants
#DEFINE xlLeft  -4131
#DEFINE xlRight  -4152
#DEFINE xlTop  -4160
#DEFINE xlContext  -5002


.HorizontalAlignment = xlRight
.VerticalAlignment = xlBottom
.ReadingOrder = xlContext
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform