Hi all
I don't know , it gives me a error.
Ambiguous name detected:RemoveToolBars
Maybe this is the problem.I do not have
VB installed.I'm using VBE and VBA
in Excel.
Maybe someone has a different solution. I've written a small program and I
don't
want anyone to fiddle.I have locked the all that can be locked and that is
fine.
But now when the welcome note displays, it doesn't close the area in the
sheet on all CPU's the same. Sometimes only half of the area is closed.
Any help?
"Jean-Yves" wrote:
Hi all
As I have option explicit (all varaiable have to be declared)
x as to be declared as well
Option Explicit
Public TBVis() As Boolean
Sub RemoveToolBars()
ReDim TBVis(Application.Toolbars.Count)
Dim x As Integer
For x = 1 To Application.Toolbars.Count
TBVis(x) = Application.Toolbars(x).Visible
Application.Toolbars(x).Visible = False
Next x
End Sub
Sub RestoreToolBars()
On Error Resume Next
Dim x As Integer
For x = 1 To Application.Toolbars.Count
Application.Toolbars(x).Visible = TBVis(x)
Next x
End Sub
Regards
JY
"Paulo Alexandre ( PT )" wrote
in message ...
Hi
For me worked almost fine, it missed one, I'm triyng to find why.
PP
"Mr.G" wrote:
J-Y
Thanks but doesn't work. Don't bombard me now.I'm still newbee with VB.
Your first line breaks it a statement on its own when I insert on WB
open.
Anymore help?
"Jean-Yves" wrote:
HI,
From Google
| Public TBVis() As Boolean
|
| Sub RemoveToolBars()
| ReDim TBVis(Application.Toolbars.Count)
| For x = 1 To Application.Toolbars.Count
| TBVis(x) = Application.Toolbars(x).Visible
| Application.Toolbars(x).Visible = False
| Next x
| End Sub
|
| Sub RestoreToolBars()
| On Error Resume Next
| For x = 1 To Application.Toolbars.Count
| Application.Toolbars(x).Visible = TBVis(x)
| Next x
| End Sub
|
Regards
JY
"Mr.G" wrote in message
...
I want to close the toolbars that is open in Excel when a certain book
is
opened. I don't have a problem closing all toolbars and opening all
again
when you exit book.
I want VB to select the open ones and replace on exit again.
Any help?