Value of vertical alignment constants for Excel 97 
Author Message
 Value of vertical alignment constants for Excel 97

There are times when good old Microsoft leaves me tearing my hair out.  This
is one of those occasions where I've spent hours over a few lines of code
for want of a bit of clearly presented documentation.  A concept that is
alien to Bill and his chums in Redmond...

I'm using automation to manipulate an Excel 97 workbook from Access 97.
It's all working OK, except that I'm having problems with expressions that
would normally use Excel constants, such as

            With Selection
                    .VerticalAlignment = xlCenter

I've found that Access reports an error if the xlCenter constant is used (or
any other one for that matter).  It seems that xlCenter has to be passed as
a numeric value.

I've found a couple of code snippets where someone has obviously managed to
find what Microsoft seem intent on keeping secret...

            With .Selection
                .HorizontalAlignment = 7            'xlCenterAcrossSelection
                .VerticalAlignment = -4107          'xlBottom

Unfortunately, I'm currently looking for the equivalent value of xlCenter,
but the rest would be handy!

Does anyone know where I can find the numeric equivalents for the constants
used by the Excel 97 object model?

I've searched all over the place but, so far, it's been a complete waste of
time.

Many thanks if you can point me in the right direction

Mike



Tue, 27 Jul 2004 06:51:02 GMT  
 Value of vertical alignment constants for Excel 97
Isn't it always the case.  Post a message asking for help and 10 minutes
later you find the answer yourself.

xlCenter has a value of -4108

I eventually used the Excel object browser  - found the entry for
'constants' in the classes list, then xlCenter in the members list...

Mike


Quote:
> There are times when good old Microsoft leaves me tearing my hair out.
This
> is one of those occasions where I've spent hours over a few lines of code
> for want of a bit of clearly presented documentation.  A concept that is
> alien to Bill and his chums in Redmond...

> I'm using automation to manipulate an Excel 97 workbook from Access 97.
> It's all working OK, except that I'm having problems with expressions that
> would normally use Excel constants, such as

>             With Selection
>                     .VerticalAlignment = xlCenter

> I've found that Access reports an error if the xlCenter constant is used
(or
> any other one for that matter).  It seems that xlCenter has to be passed
as
> a numeric value.

> I've found a couple of code snippets where someone has obviously managed
to
> find what Microsoft seem intent on keeping secret...

>             With .Selection
>                 .HorizontalAlignment = 7

'xlCenterAcrossSelection

- Show quoted text -

Quote:
>                 .VerticalAlignment = -4107          'xlBottom

> Unfortunately, I'm currently looking for the equivalent value of xlCenter,
> but the rest would be handy!

> Does anyone know where I can find the numeric equivalents for the
constants
> used by the Excel 97 object model?

> I've searched all over the place but, so far, it's been a complete waste
of
> time.

> Many thanks if you can point me in the right direction

> Mike



Tue, 27 Jul 2004 07:06:53 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Value of vertical alignment constants for Excel 97

2. vertical text alignment with Excel 2002

3. Excel XP Vertical Alignment Option

4. Excel Vertical Alignment Option

5. Access '97: Changing a constant value in module

6. Vertical Alignment for Label?

7. Vertical alignment of text

8. Vertical text alignment

9. Vertical alignment...

10. A97: Reports / Text Box Formatting / Vertical Alignment?


 
Powered by phpBB® Forum Software © phpBB Group