Value of vertical alignment constants for Excel 97
If you have a copy of Excel handy, just open the VB Editor, access the
Immediate window, and type something like this:
? xlCenter
That will give you the numeric value for the xlCenter constant.
If you'd prefer a complete list, here's a link to a file created by Chip
Pearson. It lists all of the Excel and Office enums, their member constants,
and associated values. A very handy reference!
www.cpearson.com/zips/xlconsts.zip
John Walkenbach
For Excel tips, macros, & downloads...
http://j-walk.com/ss
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
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