ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Restoring Attached Toolbar (https://www.excelbanter.com/excel-programming/405410-restoring-attached-toolbar.html)

Steve

Restoring Attached Toolbar
 
I have an application that deletes my attached toolbar when the file is
closed. The problem I am having is when two files, using the same toolbar,
are opened, and one is then closed, the toolbar is deleted. When I go to the
view\toolbars\customize\attach window, it shows that the toolbar is still in
the workbook. I have tried using "Application.CommandBars("Equipment
List").Enabled = True", but that doesn't work. Is there a way I can restore
the toolbar without having to close, and re-open?

Thanks,
Steve

JLGWhiz

Restoring Attached Toolbar
 
try visible instead of enabled

"Steve" wrote:

I have an application that deletes my attached toolbar when the file is
closed. The problem I am having is when two files, using the same toolbar,
are opened, and one is then closed, the toolbar is deleted. When I go to the
view\toolbars\customize\attach window, it shows that the toolbar is still in
the workbook. I have tried using "Application.CommandBars("Equipment
List").Enabled = True", but that doesn't work. Is there a way I can restore
the toolbar without having to close, and re-open?

Thanks,
Steve


Steve

Restoring Attached Toolbar
 
I tried that too, with no success.

"JLGWhiz" wrote:

try visible instead of enabled

"Steve" wrote:

I have an application that deletes my attached toolbar when the file is
closed. The problem I am having is when two files, using the same toolbar,
are opened, and one is then closed, the toolbar is deleted. When I go to the
view\toolbars\customize\attach window, it shows that the toolbar is still in
the workbook. I have tried using "Application.CommandBars("Equipment
List").Enabled = True", but that doesn't work. Is there a way I can restore
the toolbar without having to close, and re-open?

Thanks,
Steve


Dave Peterson

Restoring Attached Toolbar
 
I wouldn't attach a toolbar to a workbook.

I'd build another workbook (an addin???) that contained the code to build the
toolbar and the code for each of the macros.

And I'd load that workbook/addin whenever I opened a workbook that needed those
macros.

And by separating the code from each of the individual data workbooks, I only
have one location to update when the code needs to change.

If you like that idea...

For additions to the worksheet menu bar, I really like the way John Walkenbach
does it in his menumaker workbook:
http://j-walk.com/ss/excel/tips/tip53.htm

Here's how I do it when I want a toolbar:
http://www.contextures.com/xlToolbar02.html
(from Debra Dalgleish's site)

And if you use xl2007:

If you want to learn about modifying the ribbon, you can start at Ron de Bruin's
site:
http://www.rondebruin.nl/ribbon.htm
http://www.rondebruin.nl/qat.htm -- For macros for all workbooks (saved as an
addin)
or
http://www.rondebruin.nl/2007addin.htm

In xl2007, those toolbars and menu modifications will show up under the addins.

Steve wrote:

I have an application that deletes my attached toolbar when the file is
closed. The problem I am having is when two files, using the same toolbar,
are opened, and one is then closed, the toolbar is deleted. When I go to the
view\toolbars\customize\attach window, it shows that the toolbar is still in
the workbook. I have tried using "Application.CommandBars("Equipment
List").Enabled = True", but that doesn't work. Is there a way I can restore
the toolbar without having to close, and re-open?

Thanks,
Steve


--

Dave Peterson

Steve

Restoring Attached Toolbar
 
I considered that when I first started developing my application. I didnt
know if I wanted to get caught with numerous versions of the toolbar as the
application evolved. In hindsight, I find that its the code thats changing
more often than the application.

"Dave Peterson" wrote:

I wouldn't attach a toolbar to a workbook.

I'd build another workbook (an addin???) that contained the code to build the
toolbar and the code for each of the macros.

And I'd load that workbook/addin whenever I opened a workbook that needed those
macros.

And by separating the code from each of the individual data workbooks, I only
have one location to update when the code needs to change.

If you like that idea...

For additions to the worksheet menu bar, I really like the way John Walkenbach
does it in his menumaker workbook:
http://j-walk.com/ss/excel/tips/tip53.htm

Here's how I do it when I want a toolbar:
http://www.contextures.com/xlToolbar02.html
(from Debra Dalgleish's site)

And if you use xl2007:

If you want to learn about modifying the ribbon, you can start at Ron de Bruin's
site:
http://www.rondebruin.nl/ribbon.htm
http://www.rondebruin.nl/qat.htm -- For macros for all workbooks (saved as an
addin)
or
http://www.rondebruin.nl/2007addin.htm

In xl2007, those toolbars and menu modifications will show up under the addins.

Steve wrote:

I have an application that deletes my attached toolbar when the file is
closed. The problem I am having is when two files, using the same toolbar,
are opened, and one is then closed, the toolbar is deleted. When I go to the
view\toolbars\customize\attach window, it shows that the toolbar is still in
the workbook. I have tried using "Application.CommandBars("Equipment
List").Enabled = True", but that doesn't work. Is there a way I can restore
the toolbar without having to close, and re-open?

Thanks,
Steve


--

Dave Peterson



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

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