M
Mark
Hi,
I'm trying to use VBA in excel to remove all toolbars on opening a spreadsheet using auto-open and then to restore all when closing using aut-close.
The code I am using is as follows:-
Sub HideAllToolbars()
' 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
End Sub
' This is a sub-routine to show all of the toolbars.
Sub ShowAllToolbars()
'loop variable
Dim i As Integer
' Loop through the total number of toolbars.
For i = 1 To Application.Toolbars.Count
' Show each toolbar.
Application.Toolbars(i).Visible = True
' End of loop.
Next i
End Sub
The problem is that whilst the above works on reinstating toolbars I get far more than were originally visible. As I want to use the code on numerous machines I need to be able to restore the exact toolbars that a network user originally had.
Any ideas?
Thanks,
Mark
I'm trying to use VBA in excel to remove all toolbars on opening a spreadsheet using auto-open and then to restore all when closing using aut-close.
The code I am using is as follows:-
Sub HideAllToolbars()
' 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
End Sub
' This is a sub-routine to show all of the toolbars.
Sub ShowAllToolbars()
'loop variable
Dim i As Integer
' Loop through the total number of toolbars.
For i = 1 To Application.Toolbars.Count
' Show each toolbar.
Application.Toolbars(i).Visible = True
' End of loop.
Next i
End Sub
The problem is that whilst the above works on reinstating toolbars I get far more than were originally visible. As I want to use the code on numerous machines I need to be able to restore the exact toolbars that a network user originally had.
Any ideas?
Thanks,
Mark