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


Hi,

I have a workbook that works under "allmost" FullScreen.
On opening it, or Activate, is "throws out" (hides) all the toolbars
with:

' Dimension a loop variable.
Dim i As Integer
' Loop through the total number of toolbars.
For i = 1 To Application.Toolbars.Count
' Hide each toolbar.
Application.Toolbars(i).Visible = False
' End of loop.
Next i

Only The Menu bar remains.
Now, when Closing (or Deactivate) this workbook I want to restore some
toolbars.

Application.DisplayFormulaBar = True
Application.DisplayStatusBar = True

works just fine for the Formula and Status bars.

But I can't manage the Standard/Formatting/Drawing bars.

I think the problem is because I work with the Portuguese XP version.
Drawing = "Desenho" / Standard = "Padrao" etc.
But even using these terms doesn't resolve.
And anyway, I want that even with XP in Swahili my workbook can be
used.

Question: Must I use int. ID codes for these bars ??

Regards

S.Krol / :)


--
skrol
------------------------------------------------------------------------
skrol's Profile: http://www.excelforum.com/member.php...o&userid=27126
View this thread: http://www.excelforum.com/showthread...hreadid=470450

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

Try this instead


Option Explicit


Private mFormulaBar


Private Sub Workbook_Activate()
Dim oCB As CommandBar


'Remove commandbars
For Each oCB In Application.CommandBars
oCB.Enabled = False
Next


'RemoveFormulaBar
mFormulaBar = Application.DisplayFormulaBar
Application.DisplayFormulaBar = False
End Sub


Private Sub Workbook_Deactivate()
Dim oCB As CommandBar


'Restore commandbars
For Each oCB In Application.CommandBars
oCB.Enabled = True
Next


'RestoreFormulaBar
Application.DisplayFormulaBar = mFormulaBar
End Sub


'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


--
HTH

Bob Phillips

"skrol" wrote in
message ...

Hi,

I have a workbook that works under "allmost" FullScreen.
On opening it, or Activate, is "throws out" (hides) all the toolbars
with:

' Dimension a loop variable.
Dim i As Integer
' Loop through the total number of toolbars.
For i = 1 To Application.Toolbars.Count
' Hide each toolbar.
Application.Toolbars(i).Visible = False
' End of loop.
Next i

Only The Menu bar remains.
Now, when Closing (or Deactivate) this workbook I want to restore some
toolbars.

Application.DisplayFormulaBar = True
Application.DisplayStatusBar = True

works just fine for the Formula and Status bars.

But I can't manage the Standard/Formatting/Drawing bars.

I think the problem is because I work with the Portuguese XP version.
Drawing = "Desenho" / Standard = "Padrao" etc.
But even using these terms doesn't resolve.
And anyway, I want that even with XP in Swahili my workbook can be
used.

Question: Must I use int. ID codes for these bars ??

Regards

S.Krol / :)


--
skrol
------------------------------------------------------------------------
skrol's Profile:

http://www.excelforum.com/member.php...o&userid=27126
View this thread: http://www.excelforum.com/showthread...hreadid=470450



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Toolbars Disable/Enable


Thanks Bob,
I'm going to try it.......................

:)


--
skrol
------------------------------------------------------------------------
skrol's Profile: http://www.excelforum.com/member.php...o&userid=27126
View this thread: http://www.excelforum.com/showthread...hreadid=470450

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
Combo Box enable and disable Vinod[_2_] Excel Worksheet Functions 3 November 6th 07 05:30 PM
enable/disable macro RICK Excel Discussion (Misc queries) 4 June 15th 06 07:55 PM
Disable CUT via toolbars or shortcut keys sparx Excel Discussion (Misc queries) 0 April 30th 06 08:34 PM
Enable/Disable macros Adam Excel Discussion (Misc queries) 2 March 11th 05 10:29 AM
Enable toolbars at close Pete Excel Programming 4 April 15th 04 06:34 PM


All times are GMT +1. The time now is 02:54 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"