Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
When my workbook opens, I make all commandbars invisible except the
standard menubar and the workbook's custom toolbar. I have the custom toolbar in the right place vertically (just below the menubar). How do I center it horizontally? TIA, James |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Mar 31, 12:22�pm, "Zone" wrote:
When my workbook opens, I make all commandbars invisible except the standard menubar and the workbook's custom toolbar. *I have the custom toolbar in the right place vertically (just below the menubar). *How do I center it horizontally? *TIA, James I mean, I want VBA to center my toolbar. J |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi James,
When my workbook opens, I make all commandbars invisible except the standard menubar and the workbook's custom toolbar. I have the custom toolbar in the right place vertically (just below the menubar). How do I center it horizontally? TIA, James for centering a toolbar: Sub TestCenter() Dim x As Long Dim v As Long v = Application.CommandBars("formatting").Width x = System.HorizontalResolution Application.CommandBars("formatting").Left = x / 2 - v / 2 End Sub Though occasionally, System.HorizontalResolution tells me, that an ActiveX object could not be created. Why? I don't know. -- Greetings from Bavaria, Germany Helmut Weber, MVP WordVBA Win XP, Office 2003 "red.sys" & Chr$(64) & "t-online.de" |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Mar 31, 2:51�pm, Helmut Weber wrote:
Helmut, line x = System.HorizontalResolution gives me run-time error 424, object required. I am using Excel 2002 on Windows XP. James Hi James, When my workbook opens, I make all commandbars invisible except the standard menubar and the workbook's custom toolbar. *I have the custom toolbar in the right place vertically (just below the menubar). *How do I center it horizontally? *TIA, James for centering a toolbar: Sub TestCenter() Dim x As Long Dim v As Long v = Application.CommandBars("formatting").Width x = System.HorizontalResolution Application.CommandBars("formatting").Left = x / 2 - v / 2 End Sub Though occasionally, System.HorizontalResolution tells me, that an ActiveX object could not be created. Why? I don't know. -- Greetings from Bavaria, Germany Helmut Weber, MVP WordVBA Win XP, Office 2003 "red.sys" & Chr$(64) & "t-online.de" |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi James,
there must be a bug in it. I got the same message a few times, then it disappeared. I never get it in Word. If the macro is just for you, you may try it with 1024 or 1200 or whatever. And it applies to a maximized window. -- Greetings from Bavaria, Germany Helmut Weber, MVP WordVBA Win XP, Office 2003 "red.sys" & Chr$(64) & "t-online.de" |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Mar 31, 3:17?pm, Helmut Weber wrote:
Danka, Helmut, and hallo to beautiful Bavaria. I'm using a wide- screen laptop, if that makes any difference. I will try your suggestion. J Hi James, there must be a bug in it. I got the same message a few times, then it disappeared. I never get it in Word. If the macro is just for you, you may try it with 1024 or 1200 or whatever. And it applies to a maximized window. -- Greetings from Bavaria, Germany Helmut Weber, MVP WordVBA Win XP, Office 2003 "red.sys" & Chr$(64) & "t-online.de" |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Helmut, this works fine:
Sub TestCenterJ() Dim WideScr As Variant Dim x As Long Dim v As Long v = Application.CommandBars("formatting").Width WideScr = MsgBox("Wide screen?", vbYesNo) If WideScr = vbYes Then x = 1325 Else x = 1024 End If Application.CommandBars("formatting").Left = x / 2 - v / 2 End Sub Of course, the problem is the program should be able to automatically gather this screen horiz center information. Since your System.HorizontalResolution won't work for me (Excel 2002), I'm at a loss. Having to ask the user for this info is really embarrassing! James On Mar 31, 3:33�pm, "Zone" wrote: On Mar 31, 3:17?pm, Helmut Weber wrote: Danka, Helmut, and hallo to beautiful Bavaria. *I'm using a wide- screen laptop, if that makes any difference. *I will try your suggestion. *J Hi James, there must be a bug in it. I got the same message a few times, then it disappeared. I never get it in Word. If the macro is just for you, you may try it with 1024 or 1200 or whatever. And it applies to a maximized window. -- Greetings from Bavaria, Germany Helmut Weber, MVP WordVBA Win XP, Office 2003 "red.sys" & Chr$(64) & "t-online.de"- Hide quoted text - - Show quoted text - |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Center Comments on Center of Screen | Excel Discussion (Misc queries) | |||
Merge and Center and Center Accross Selection | New Users to Excel | |||
TOOLBAR button or Keyboard Shortcut FOR Center Across Selection?? | Excel Discussion (Misc queries) | |||
shortcut to center text other than format toolbar? | Excel Discussion (Misc queries) | |||
Center Across Selection Vertically Help. I am trying to center te. | Excel Discussion (Misc queries) |