Enumerated constants defined where?

  • Thread starter Thread starter JW
  • Start date Start date
J

JW

Where are the MsoBarPosition constants stored?

Doesn't matter what I use (msoBarLeft, msoBarTop, msoBarRight, msoBarBottom,
msoBarFloating, msoBarPopup, or msoBarMenuBar), it's appearing at left. If I use
a number instead of the constant, it works. Obviously it's defaulting to
msoBarLeft (0).

For fun, type "MsoBarPosition" into Google and see what they suggest for "Did
you mean"...

TIA.

jon
 
The constants are stored in the Office DLL file, typically
C:\Program Files\Common Files\Microsoft Shared\office11\mso.dll


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
JW:

Let me add some background to Chip's reply..


You probably do not use

Option Explicit

if variables do not need to be declared then using s'th like
AnyOddConstant will just return an Empty Variant

(unless ofcourse you or a referenced library has defined the constant)

so:
in your project you must set a reference to:
Microsoft Office 10.0 Object Library (version may be different)

and:
it's VERY good practive to ALWAYS use Option Explicit
to force this:
in the VBE =>
=> Tools Options
=> Require Variable Declaration CHECK



HTH


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


JW wrote :
 
keepITcool said:
JW:

Let me add some background to Chip's reply..


You probably do not use

Option Explicit

if variables do not need to be declared then using s'th like
AnyOddConstant will just return an Empty Variant

(unless ofcourse you or a referenced library has defined the constant)

so:
in your project you must set a reference to:
Microsoft Office 10.0 Object Library (version may be different)

and:
it's VERY good practive to ALWAYS use Option Explicit
to force this:
in the VBE =>
=> Tools Options
=> Require Variable Declaration CHECK

Thanks for your suggestions, which indeed worked. When using VB, I always set
Option Explicit. Guess I'm lazier when it comes to VBA & Vbscript. Learned my
lesson.

jon
 
JW,

You can have VBA automatically add 'Option Explicit' to all new
code modules. In VBA, go to the Tools menu, choose Options,
Editor tab, and check "Require Variable Declaration".


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top