Declaring Variable as VBConstant

T

The Vision Thing

I've using the following to call a proc. to create a custom toolbar. But
I'm uncertain as to what to dim the variable vbPosition as, as I'm assigning
it the vb constant msoBarTop.

Sub Test()
Dim arrToolCaption As Variant, arrToolMacro As Variant, strDelimiter As
String, vbPosition As Variant
arrToolCaption = Array("Tool1", "Tool2", "Tool3", "Tool4")
arrToolMacro = Array("Macro1", "Macro2", "Macro3", "Macro4")
strDelimiter = " |"
vbPosition = msoBarTop
CreateToolbar arrToolCaption, arrToolMacro, strDelimiter, vbPosition
End Sub

Thanks,
Wayne C.
 
J

Jon Peltier

Wayne -

According to VBA Help:

Add Method

Creates a new command bar and adds it to the collection of command bars.
Returns a CommandBar object.

expression.Add(Name, Position, MenuBar, Temporary)

expression Required. An expression that returns a CommandBars object.

Name Optional Variant. The name of the new command bar. If this
argument is omitted, a default name is assigned to the command bar (such
as Custom 1).

Position Optional Variant. The position or type of the new command bar.
Can be one of the MsoBarPosition constants listed in the following table.

Constant Description

msoBarLeft, msoBarTop, msoBarRight, msoBarBottom Indicates the left,
top, right, and bottom coordinates of the new command bar

msoBarFloating Indicates that the new command bar won't be docked

msoBarPopup Indicates that the new command bar will be a shortcut menu

msoBarMenuBar Macintosh only

MenuBar Optional Variant. True to replace the active menu bar with the
new command bar. The default value is False.

Temporary Optional Variant. True to make the new command bar temporary.
Temporary command bars are deleted when the container application is
closed. The default value is False.


- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
 
T

The Vision Thing

Thanks Jon.

Jon Peltier said:
Wayne -

According to VBA Help:

Add Method

Creates a new command bar and adds it to the collection of command bars.
Returns a CommandBar object.

expression.Add(Name, Position, MenuBar, Temporary)

expression Required. An expression that returns a CommandBars object.

Name Optional Variant. The name of the new command bar. If this
argument is omitted, a default name is assigned to the command bar (such
as Custom 1).

Position Optional Variant. The position or type of the new command bar.
Can be one of the MsoBarPosition constants listed in the following table.

Constant Description

msoBarLeft, msoBarTop, msoBarRight, msoBarBottom Indicates the left,
top, right, and bottom coordinates of the new command bar

msoBarFloating Indicates that the new command bar won't be docked

msoBarPopup Indicates that the new command bar will be a shortcut menu

msoBarMenuBar Macintosh only

MenuBar Optional Variant. True to replace the active menu bar with the
new command bar. The default value is False.

Temporary Optional Variant. True to make the new command bar temporary.
Temporary command bars are deleted when the container application is
closed. The default value is False.


- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
 
Top