Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > VBA / Office Integration > Excel > Fine Tuning Toolbars


Reply
 
Thread Tools Display Modes
  #1  
Old 07-02-2003, 08:50 AM
MDodd73's Avatar
MDodd73 MDodd73 is offline
Junior Contributor
 
Join Date: Mar 2003
Location: PA, USA
Posts: 303
Red face Fine Tuning Toolbars


Hey Everyone:

So I'm fine tuning this wonderful Sales oriented application (about 2 days away from the testing phase) and I'm getting annoyed by a tiny problem-- the starting position of my Custom Toolbar...

See, I get Excel to loose all of the tool bars and the main menu bar and leave just my own custom jobbie... which works out fine...

Here-- I have an _Open event that calls this:

Code:
Sub HideBars() Dim ToolBrs As CommandBar Dim ToolBarNum As Integer Dim ToolSheet As Worksheet Workbooks("Contact Manager.xls").Activate Sheets("TBSheet").Visible = True Set ToolSheet = Sheets("TBSheet") Application.DisplayAlerts = False Application.ScreenUpdating = False Sheets("TBSheet").Visible = True ToolSheet.Unprotect "7477" 'This will hide all visible toolbars except 'My Custom made toolbar called "Contact Manager" ToolBarNum = 0 For Each ToolBrs In Application.CommandBars If ToolBrs.Type = msoBarTypeNormal Then If ToolBrs.Name = "Contact Manager" Then GoTo NextOne Else If ToolBrs.Visible Then ToolBarNum = ToolBarNum + 1 ToolBrs.Visible = False ToolSheet.Cells(ToolBarNum, 1) = ToolBrs.Name End If End If End If NextOne: Next ToolBrs With Application .DisplayFormulaBar = False .DisplayStatusBar = False .ShowWindowsInTaskbar = False End With CommandBars("Worksheet Menu Bar").Enabled = False Application.DisplayAlerts = True Application.ScreenUpdating = True Sheets("TBSheet").Visible = False End Sub

Now the thing is, depending on where my Custom Toolbar was hanging out last determines where it hangs out when I open it again-- and lord knows where it'll wannna show up with each user.

So how can I position it to hang out at the Top Left Corner of the Window?

Just the Syntax would help enormously...

Thanks everyone-- this application would have never made it this far without you all...

--Dodd
__________________
"Princekimmer Skimple... Primable Skimster... I, I found something!!!!"
--Ralph Wiggum
Reply With Quote
  #2  
Old 07-02-2003, 09:03 AM
italkid's Avatar
italkid italkid is offline
Down...

Retired Moderator
* Expert *
 
Join Date: Dec 2002
Location: Belgium.
Posts: 6,731
Default

Like this :
Code:
With Application.CommandBars("your bar") .Position = msoBarFloating .Left = 200 .Top = 200 .Visible = True End With
Play around with the "Left" & "Top" values
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Subscript error on XP fine on 98 Chazz569 General 9 03-22-2003 11:30 AM
Argh!!! Class works fine until it is a dll planet-boss General 7 12-28-2002 12:18 AM
Toolbars scroll away skippy General 1 06-19-2002 03:59 PM
Word VBA: Getting rid of all Word Toolbars... simonsays Word, PowerPoint, Outlook, and Other Office Products 1 06-14-2002 12:14 AM
toolbars and macro's pells Word, PowerPoint, Outlook, and Other Office Products 12 10-09-2001 07:00 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->