Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 -- |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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" wrote in message ... 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 -- |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 : 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"keepITcool" wrote:
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 -- |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 "JW" wrote in message ... "keepITcool" wrote: 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 -- |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() good advice Chip.. I told him so already <g yo! -- keepITcool | www.XLsupport.com | keepITcool chello nl | amsterdam Chip Pearson wrote : 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". "JW" wrote in message ... "keepITcool" wrote: and: it's VERY good practive to ALWAYS use Option Explicit to force this: in the VBE = = Tools Options = Require Variable Declaration CHECK |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I didn't notice you'd already said it.
-- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "keepITcool" wrote in message ... good advice Chip.. I told him so already <g yo! -- keepITcool | www.XLsupport.com | keepITcool chello nl | amsterdam Chip Pearson wrote : 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". "JW" wrote in message ... "keepITcool" wrote: and: it's VERY good practive to ALWAYS use Option Explicit to force this: in the VBE = = Tools Options = Require Variable Declaration CHECK |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Wierd names defined as arrays of constants?!? | Excel Discussion (Misc queries) | |||
Wierd names defined as arrays of constants?!? | Excel Discussion (Misc queries) | |||
Run-time error '50290': Application-defined or object-defined erro | Excel Discussion (Misc queries) | |||
"User-defined type not defined" message in Excel | Excel Discussion (Misc queries) | |||
Word.Document - user defined type not defined | Excel Programming |