Archive of Mr Excel Message Board


Back to General Excel archive index
Back to archive home

Custom Toolbar

Posted by George on December 15, 2001 9:26 AM
I have created a custom toolbar that i only want to use for one workbook. The toolbar contains a button with a macro that Closes the toolbar, saves the workbook, then closes it. This works OK.

The problem is that when I open the workbook, i want the toolbar to appear automatically.

I created an AutoExec VBA Module to do this, but it doesnt work. The toolbar will display if i run the AutoExec Macro once the sheet is open.

The code for my AutoExec VBA Module is:

Sub Main()
Application.CommandBars("tbr").Visible = True
End Sub()

Am i doing something wrong?


Re: Custom Toolbar

Posted by Jim on December 15, 2001 9:39 AM
Hi George,

This should do it:

Private Ssub Workbook_Open()
'Your code
End Sub

Jim


Re: Custom Toolbar

Posted by George on December 15, 2001 11:33 AM
Do I put that in the AutoExec Module?


Re: Custom Toolbar

Posted by Jim on December 15, 2001 12:07 PM
Hi George,

Firstly i don't know to spell is should read:

Private Sub Workbook_Open()
'Your code
End Sub

1.keypress alt F11
2.in your VBA Project click on "ThisWorkbook"
3.type your code

Regards,
Jim


Re: Custom Toolbar

Posted by George on December 16, 2001 7:06 AM
Thanks Jim.


This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.