Toolbar should not load at startup

S

sharkfoot

I have a couple of custom toolbars, one of which is coded to loa
automatically when opening the workbook. The other should only come u
with a button, which works fine, but it also loads at startup and n
matter what I do I can't keep it from showing up when the workboo
opens.

Here is what I currently have:


Code
-------------------
Sub Auto_Open()

Toolbars("TNT Toolkit").Visible = True
End Sub

Sub Auto_Close()

Toolbars("TNT Toolkit").Delete
Toolbars("WOFC Menu").Delete
Toolbars("AlSTH Menu").Delete
End Sub
-------------------


They all delete just fine, but the *ALSTH Menu* toolbar opens when th
workbook opens and is giving me a headache. What do I do to keep i
closed
 
D

davesfx

Sharkfoot,

If you want specific toolbars to open with specific books, you would
place this under "ThisWorkbook" module. Something like this below.

Private Sub Workbook_Open()
Call CreateDavesTools
End Sub

In which Sub CreateDavesTools, is a sub in the module that creates the
toolbars.

You would also have another routine when the workbook closes, such as:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim x As Integer
For x = 1 To 50
Application.CommandBars(x).Reset
Next x
End Sub

The above sub simply resets all toolbars.

I couldn't help notice and I hope its just a typo, but I see in your
sub you have "AISTH Menu" and in your comments you have "ALSTH Menu".
Is that a typo or your problem.

Hope I have helped and I could elaborate more or I am sure someone else
will. Have a great day.

davesfx
 
D

davesfx

Sharkfoot,

If you want specific toolbars to open with specific books, you would
place this under "ThisWorkbook" module. Something like this below.

Private Sub Workbook_Open()
Call CreateDavesTools
End Sub

In which Sub CreateDavesTools, is a sub in the module that creates the
toolbars.

You would also have another routine when the workbook closes, such as:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim x As Integer
For x = 1 To 50
Application.CommandBars(x).Reset
Next x
End Sub

The above sub simply resets all toolbars.

I couldn't help notice and I hope its just a typo, but I see in your
sub you have "AISTH Menu" and in your comments you have "ALSTH Menu".
Is that a typo or your problem.

Hope I have helped and I could elaborate more or I am sure someone else
will. Have a great day.

davesfx
 
G

Guest

Where is the *ALSTH Menu* defined?
Would Toolbars("ALSTH Menu").Visible = False stop it from showing?
 
S

sharkfoot

bigwheel said:
Where is the *ALSTH Menu* defined?
Would Toolbars("ALSTH Menu").Visible = False stop it from showing?


I've tried the =false thing to no avail. Not sure what you mean b
"where is the toolbar defined" but it's a custom toolbar created usin
excel. Is that what you meant
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top