PC Review


Reply
Thread Tools Rate Thread

Commandbar Position

 
 
jkend69315@aol.com
Guest
Posts: n/a
 
      2nd Jun 2006
I asked this question earlier but got no reply. I want my commandbar
(a toolbar attached to a workbook) to always appear as the bottom-most
commandbar at the top of the screen, centered horizontally, when the
workbook opens. Seems like this shouldn't be all that difficult, but
apparently it is a problem in Excel (2002). Thanks! James

 
Reply With Quote
 
 
 
 
Bernie Deitrick
Guest
Posts: n/a
 
      2nd Jun 2006
Try something like this macro below.

Note that attaching commandbars to worksbooks is a bad thing for your end users - much better to
create and delete the commandbar on the fly - lots of code available to show how.

HTH,
Bernie
MS Excel MVP

Sub PositionCommandbar()
Dim cbBar As CommandBar

Set cbBar = Application.CommandBars("Test")

With cbBar
.Visible = True
.Position = msoBarTop
.Left = 2000 'Put it way to the right
.Left = .Left / 2 ' adjust it to the center
End With

End Sub


<(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
>I asked this question earlier but got no reply. I want my commandbar
> (a toolbar attached to a workbook) to always appear as the bottom-most
> commandbar at the top of the screen, centered horizontally, when the
> workbook opens. Seems like this shouldn't be all that difficult, but
> apparently it is a problem in Excel (2002). Thanks! James
>



 
Reply With Quote
 
jkend69315@aol.com
Guest
Posts: n/a
 
      2nd Jun 2006
I'll be chewing on your reply for a while. Thank you.

Bernie Deitrick wrote:
> Try something like this macro below.
>
> Note that attaching commandbars to worksbooks is a bad thing for your end users - much better to
> create and delete the commandbar on the fly - lots of code available to show how.
>
> HTH,
> Bernie
> MS Excel MVP
>
> Sub PositionCommandbar()
> Dim cbBar As CommandBar
>
> Set cbBar = Application.CommandBars("Test")
>
> With cbBar
> .Visible = True
> .Position = msoBarTop
> .Left = 2000 'Put it way to the right
> .Left = .Left / 2 ' adjust it to the center
> End With
>
> End Sub
>
>
> <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> >I asked this question earlier but got no reply. I want my commandbar
> > (a toolbar attached to a workbook) to always appear as the bottom-most
> > commandbar at the top of the screen, centered horizontally, when the
> > workbook opens. Seems like this shouldn't be all that difficult, but
> > apparently it is a problem in Excel (2002). Thanks! James
> >


 
Reply With Quote
 
jkend69315@aol.com
Guest
Posts: n/a
 
      2nd Jun 2006
Say I already have a commandbar for which I have created macro calls
and buttons with faces. Is there a way to store and nab this toolbar
and create (install) it instead of having to create the macro calls and
faces everytime? Thanks

 
Reply With Quote
 
Bernie Deitrick
Guest
Posts: n/a
 
      2nd Jun 2006
Try attaching it to the workbook, and use the workbook open event to show it:

Application.CommandBars("Test").Visible = True

And use the workbook close event to delete it.

Application.CommandBars("Test").Visible = False

(Or delete it - it should stay attached to the workbook)

HTH,
Bernie
MS Excel MVP


<(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> Say I already have a commandbar for which I have created macro calls
> and buttons with faces. Is there a way to store and nab this toolbar
> and create (install) it instead of having to create the macro calls and
> faces everytime? Thanks
>



 
Reply With Quote
 
Bernie Deitrick
Guest
Posts: n/a
 
      2nd Jun 2006
Ooops,

> And use the workbook close event to delete it.


should be

And use the workbook close event to HIDE it.

Sorry,

HTH,
Bernie
MS Excel MVP


"Bernie Deitrick" <deitbe @ consumer dot org> wrote in message
news:(E-Mail Removed)...
> Try attaching it to the workbook, and use the workbook open event to show it:
>
> Application.CommandBars("Test").Visible = True
>
> And use the workbook close event to delete it.
>
> Application.CommandBars("Test").Visible = False
>
> (Or delete it - it should stay attached to the workbook)
>
> HTH,
> Bernie
> MS Excel MVP
>
>
> <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
>> Say I already have a commandbar for which I have created macro calls
>> and buttons with faces. Is there a way to store and nab this toolbar
>> and create (install) it instead of having to create the macro calls and
>> faces everytime? Thanks
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Save CommandBar position problem? Ken Slovak - [MVP - Outlook] Microsoft Outlook Program Addins 0 15th Jun 2009 02:42 PM
Force CommandBar Position Matthew Pfluger Microsoft Excel Programming 2 19th May 2008 02:38 PM
Get floating CommandBar position Patti Microsoft Excel Programming 4 18th Jul 2005 09:08 PM
CommandBar Position TOP Seli Microsoft Access Forms 1 7th Apr 2005 04:33 PM
Adjust position of a commandbar =?Utf-8?B?cXVhcnR6?= Microsoft Excel Programming 1 11th Mar 2005 06:53 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:03 PM.