Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default removing and replacing toolbars

I've got an application in which I've removed most of the normal Excel
screen objects like row and column headers, worksheet tabs and scroll bars,
because I give the users command buttons and hyperlinks to navigate around
the app. I would also like to remove all toolbars, but then have those same
toolbars reappear whenever the user opens any other workbook after my
application has closed. Is there a way to do this with VBA?

Thanks in advance,

Paul



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 473
Default removing and replacing toolbars

Paul James wrote:
I would also like to remove all toolbars, but then have those same
toolbars reappear whenever the user opens any other workbook after my
application has closed. Is there a way to do this with VBA?


Close.
You would replace the toolbars as your application is closing.

Sub Auto_Open()
ShowToolbars False
End Sub

Sub Auto_Close()
ShowToolbars True
End Sub

Sub ShowToolbars(ToBeSeen As Boolean)
Dim CB As CommandBar
For Each CB In Application.CommandBars
CB.Enabled = ToBeSeen
Next
End Sub

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default removing and replacing toolbars

Works great. Thanks (again) for the code, Bill.

I'm wondering about something - if the power goes out or there is a system
crash while the application is running, so the Auto_Close event doesn't have
a chance to restore the toolbars (which include the menu bar), how does the
user restore the objects the next time Excel runs?

Paul


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 473
Default removing and replacing toolbars

Paul James wrote:
if the power goes out or there is a system
crash while the application is running, so the Auto_Close event doesn't have
a chance to restore the toolbars (which include the menu bar), how does the
user restore the objects the next time Excel runs?


Been there - just double-click on your workbook and then close Excel using
wither a button in your application or the x button on the title bar. Your
Auto_Close will put the commandbars back.

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default removing and replacing toolbars

Good solution. Thanks, Bill.

Have a nice weekend.





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default removing and replacing toolbars

I found this code in a search and it's almost exactly what I want. An
yes, it works great. However, I want to maintain the Worksheet Men
Bar.....the one with File, Edit, View etc, but not the actua
toolbars.

Would anyone have any idea how I could adjust this code to enable me t
achieve this objective?

Thanks to Bill for his original answer which almost does the trick fo
me too, and thanks in advance for looking at my problem.

Regards

--
Message posted from http://www.ExcelForum.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
removing toolbars and taskbars from only one worksheet or workbook Jaytee Excel Discussion (Misc queries) 2 March 4th 09 08:27 PM
toolbars (removing and reinstating) Atishoo Excel Discussion (Misc queries) 2 February 20th 09 11:30 PM
Removing patterns without removing gridlines pennyb9 Excel Discussion (Misc queries) 1 July 11th 07 02:43 AM
ToolBars bach New Users to Excel 5 August 11th 05 11:10 AM
removing customized toolbars news Excel Discussion (Misc queries) 1 February 24th 05 03:11 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"