Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adjust position of a commandbar
I am using Excel 2003 with Windows XP.
I want to make the top left corner of a custom toolbar appear on the screen in line with the top left corner of cell "A1". I have tried using "Top = 0" and "Left = 0", which is where the top and left of cell A1 is, but this doesn't work on the toolbar, which appears near center of the screen. This toolbar is deleted and rebuilt on each execution based on other data. Can someone please clue me in on what I am doing wrong? All I need is for it to appear in the correct position...thanks. Thanks much in advance. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adjust position of a commandbar
Try the following. Works for me. Do not execute from the VBE or the VBE Main
Window will serve as the ActiveWindow. Sub PositionCB() Dim x As Single, y As Single With ActiveWindow x = .PointsToScreenPixelsX(0) y = .PointsToScreenPixelsY(0) End With With CommandBars("Custom 1") .Left = x .Top = y End With End Sub Regards, Greg "quartz" wrote: I am using Excel 2003 with Windows XP. I want to make the top left corner of a custom toolbar appear on the screen in line with the top left corner of cell "A1". I have tried using "Top = 0" and "Left = 0", which is where the top and left of cell A1 is, but this doesn't work on the toolbar, which appears near center of the screen. This toolbar is deleted and rebuilt on each execution based on other data. Can someone please clue me in on what I am doing wrong? All I need is for it to appear in the correct position...thanks. Thanks much in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Dim as CommandBar Does not Work | Excel Programming | |||
CommandBar Controls | Excel Programming | |||
Add-In needs to create CommandBar | Excel Programming | |||
commandbar | Excel Programming | |||
Add control to commandbar | Excel Programming |