ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Toolbars (https://www.excelbanter.com/excel-programming/345364-toolbars.html)

Bill[_30_]

Toolbars
 
Hello,
I have a workbook that utilizes three different toolbars, depending on which
worksheet you are on. So, I build the toolbars the first time the workbook
is opened, and then either hide or show a given toolbar when a worksheet is
selected. My problem is the placement of the toolbar. I want it to be in
the upper left hand corner of a chart if the sheet is a chart; or in cell A1
if the sheet is a worksheet. Here is the code I use to play the chart:


Application.CommandBars.Add(Name:="FH", Temporary:=True).Visible =
True

With ActiveWindow
Application.CommandBars("FH").Top = .PointsToScreenPixelsY(0)
Application.CommandBars("FH").Left = .PointsToScreenPixelsX(0)
End With

The problem is that the toolbar moves around as I go from page to page. It
may start out in the right position, but then move up on the menus. Anyway
to keep it where I want it each time?

Thanks,

Bill




All times are GMT +1. The time now is 11:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com