Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Hide Toolbars

Hi All
I just created an excel template and I want to know how
to hide the standard & formating toolbars as well as the
main menus of Excel, when anyone opens this template.
TIA.
JD

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Hide Toolbars


Application.Commandbars("Worksheet Menu Bar").Enabled = False
Application.Commandbars("Standard").Visible= False
Application.Commandbars("Formatting").Visible= False

Put this code in the workbook open event, and reset it on workbook close, or
even deactivate.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Jennifer" wrote in message
...
Hi All
I just created an excel template and I want to know how
to hide the standard & formating toolbars as well as the
main menus of Excel, when anyone opens this template.
TIA.
JD



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 156
Default Hide Toolbars

or...

public sub Handlebars(byval xEnable as boolean)
dim oBar as commandbar

' disable/enable ALL builtin commandabrs (toolbars & menus!)
for each obar in application.commandbars
if obar.builtin then
obar.enabled=not xEnable
end if
next

end sub

then all you do is call it from the Workbook_Open event handler like this:

Handlebars true
<<

and in the Workbook_beforeclose event like this:

Handlebars false
<<

of course, you will have to modify as needed, for example, if you still want
the user to be able to right-click on a worksheet or cell and show the popup
menus...

also, be careful with code like this, if for example you turn event-handlers
off sometime when the workbook is open (Application.enableevents=false) and
excel crashes, then it won't put them back and you have to do it the awkward
way to reset them again!

Perhaps therefore it's better to use .Visible = false instead of disabling
them...

all depends on why, and if it's a problem when the users show the toolbars
themselves through the Customize dialog by double-clicking in the commandbar
area at the top of Excel...

hth

Philip

"Bob Phillips" wrote:


Application.Commandbars("Worksheet Menu Bar").Enabled = False
Application.Commandbars("Standard").Visible= False
Application.Commandbars("Formatting").Visible= False

Put this code in the workbook open event, and reset it on workbook close, or
even deactivate.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Jennifer" wrote in message
...
Hi All
I just created an excel template and I want to know how
to hide the standard & formating toolbars as well as the
main menus of Excel, when anyone opens this template.
TIA.
JD




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Hide Toolbars

Hi Jennifer

See also
http://www.rondebruin.com/menuid.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Jennifer" wrote in message ...
Hi All
I just created an excel template and I want to know how
to hide the standard & formating toolbars as well as the
main menus of Excel, when anyone opens this template.
TIA.
JD



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
hide the menubars and toolbars Pietro Excel Discussion (Misc queries) 11 April 11th 08 02:45 PM
hide toolbars, menu bar, etc runandrun Excel Discussion (Misc queries) 0 September 22nd 05 10:16 PM
close (hide) toolbars Anthony Excel Discussion (Misc queries) 7 June 5th 05 03:19 PM
Hide toolbars Lawlera Excel Programming 3 February 3rd 04 03:37 PM
Hide all toolbars auto_open Nigel Cummins Excel Programming 0 July 9th 03 10:17 AM


All times are GMT +1. The time now is 10:27 PM.

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

About Us

"It's about Microsoft Excel"