ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Custom Toolbar (https://www.excelbanter.com/excel-programming/285281-custom-toolbar.html)

Tom Ulincy[_2_]

Custom Toolbar
 
I created a custom toolbar (Excel 2002, Win XP) and it
works on my pc. If I email the file the user gets a Run
Time Error message when opening the workbook. (Article
291068 Visible property does not apply to all commandbars -
Can't move focus to the control because it is invisible,
not enabled or of a type that does not accept the focus.)
The MS knowledge base acknowledges this is a problem but
does not seem to offer a solution.

Is there a way to save/send a file so other's can use a
custom toolbar?

TIA
Tom


Bill Manville

Custom Toolbar
 
Tom Ulincy wrote:
If I email the file the user gets a Run
Time Error message when opening the workbook.

The way to use custom toolbars is:
a) attach the toolbar to your workbook (View / Toolbars / Customize /
Attach)
b) in your workbook's BeforeClose procedure (in ThisWorkbook module),
delete the toolbar from the user's customisation

Private Sub Workbook_BeforeClose(Cancel As Boolean)
On Error Resume Next
Application.Commandbars("MyBar").Delete
End Sub

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup




All times are GMT +1. The time now is 05:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com