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

I need to add a line to an Auto_Open() that turns off all
toolbars. What would the code be?

Thanks,
Phil
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Tuning Off Toolbars

Hi Phil

Try this

Dim bar As CommandBar
For Each bar In Application.CommandBars
bar.Enabled = False
Next

Set it to True to get them back


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Phil Hageman" wrote in message ...
I need to add a line to an Auto_Open() that turns off all
toolbars. What would the code be?

Thanks,
Phil



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

Use this if you want to keep the menubar

Dim a As Integer
For a = 2 To Application.CommandBars.Count
CommandBars(a).Enabled = False
Next


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Ron de Bruin" wrote in message ...
Hi Phil

Try this

Dim bar As CommandBar
For Each bar In Application.CommandBars
bar.Enabled = False
Next

Set it to True to get them back


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Phil Hageman" wrote in message ...
I need to add a line to an Auto_Open() that turns off all
toolbars. What would the code be?

Thanks,
Phil





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 160
Default Tuning Off Toolbars

Ron, Thanks for your reply - appreciate your time. I want
to keep the menu bar and turn off all tool bars. I've
tried to enter your code but can't get it to work. Below
is the entire sub (copy/paste, underscores absent). Could
you put it where it belongs? Again, Thanks.

Sub Auto_Open()

'Turn off updating so code runs faster
Application.ScreenUpdating = False

For Each ws In Worksheets
If ws.Visible = xlSheetVisible Then
ws.Select
Application.GoTo ws.Range("A1"), True 'Active
cell is A1
ActiveWindow.DisplayGridlines = False 'Turns
off gridlines
End If
Next

'To open the workbook on the Scorecard worksheet
Worksheets("Scorecard").Select

'To change default color pink (index number 7) to
light red (for charts)
ThisWorkbook.Colors(7) = RGB(255, 124, 128)

'In percent formatted cells, returns %, if decimal or
whole number entered.
Application.AutoPercentEntry = True

'Restore screen updating
Application.ScreenUpdating = True

End Sub

-----Original Message-----
Use this if you want to keep the menubar

Dim a As Integer
For a = 2 To Application.CommandBars.Count
CommandBars(a).Enabled = False
Next


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Ron de Bruin" wrote in message

...
Hi Phil

Try this

Dim bar As CommandBar
For Each bar In Application.CommandBars
bar.Enabled = False
Next

Set it to True to get them back


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Phil Hageman"

wrote in message news:00dc01c39d7b$ab69ed10
...
I need to add a line to an Auto_Open() that turns off

all
toolbars. What would the code be?

Thanks,
Phil





.

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

Place the subs in a normal module Phil

Sub Auto_Open()
Dim a As Integer
For a = 2 To Application.CommandBars.Count
Application.CommandBars(a).Enabled = False
Next
End Sub

Sub Auto_close()
Dim a As Integer
For a = 2 To Application.CommandBars.Count
Application.CommandBars(a).Enabled = True
Next
End Sub



--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Phil Hageman" wrote in message ...
Ron, Thanks for your reply - appreciate your time. I want
to keep the menu bar and turn off all tool bars. I've
tried to enter your code but can't get it to work. Below
is the entire sub (copy/paste, underscores absent). Could
you put it where it belongs? Again, Thanks.

Sub Auto_Open()

'Turn off updating so code runs faster
Application.ScreenUpdating = False

For Each ws In Worksheets
If ws.Visible = xlSheetVisible Then
ws.Select
Application.GoTo ws.Range("A1"), True 'Active
cell is A1
ActiveWindow.DisplayGridlines = False 'Turns
off gridlines
End If
Next

'To open the workbook on the Scorecard worksheet
Worksheets("Scorecard").Select

'To change default color pink (index number 7) to
light red (for charts)
ThisWorkbook.Colors(7) = RGB(255, 124, 128)

'In percent formatted cells, returns %, if decimal or
whole number entered.
Application.AutoPercentEntry = True

'Restore screen updating
Application.ScreenUpdating = True

End Sub

-----Original Message-----
Use this if you want to keep the menubar

Dim a As Integer
For a = 2 To Application.CommandBars.Count
CommandBars(a).Enabled = False
Next


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Ron de Bruin" wrote in message

...
Hi Phil

Try this

Dim bar As CommandBar
For Each bar In Application.CommandBars
bar.Enabled = False
Next

Set it to True to get them back


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Phil Hageman"

wrote in message news:00dc01c39d7b$ab69ed10
...
I need to add a line to an Auto_Open() that turns off

all
toolbars. What would the code be?

Thanks,
Phil




.



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
Toolbars barrowhill Excel Discussion (Misc queries) 3 November 25th 05 01:51 PM
help w/ fine tuning Mike New Users to Excel 1 October 19th 05 08:58 PM
Toolbars dstiefe Excel Discussion (Misc queries) 2 August 3rd 05 08:52 PM
toolbars markg Excel Discussion (Misc queries) 1 March 14th 05 05:49 PM
Refresh & backup tuning! Rhonda[_3_] Excel Programming 0 October 22nd 03 12:57 PM


All times are GMT +1. The time now is 10:02 AM.

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"