check this out ! any feedback ?

fireslguk

Active Member
Joined
Nov 11, 2005
Messages
294
Private Sub Workbook_Activate()
With Application
.DisplayFormulaBar = False
.CommandBars("Worksheet Menu Bar").Controls("Tools").Controls("Options...").Enabled = False
.CommandBars("Worksheet Menu Bar").Controls("View").Controls("Formula Bar").Enabled = False
.CommandBars("Worksheet Menu Bar").Controls("View").Controls("Toolbars").Enabled = False
.CommandBars("Toolbar List").Enabled = False
Application.CommandBars("File").Enabled = False
Application.CommandBars("Edit").Enabled = False
Application.CommandBars("View").Enabled = False
Application.CommandBars("Worksheet Menu Bar").Controls("Insert").Enabled = False
Application.CommandBars("Format").Enabled = False
Application.CommandBars("Tools").Enabled = False
Application.CommandBars("Data").Enabled = False
Application.CommandBars("Window").Enabled = False
Application.CommandBars("Help").Enabled = False
For Each a In Application.CommandBars
Application.CommandBars(a.Name).Enabled = False
'MsgBox a.Name
Next
End With
End Sub


Private Sub Workbook_Deactivate()
With Application
.DisplayFormulaBar = True
.CommandBars("Worksheet Menu Bar").Controls("Tools").Controls("Options...").Enabled = True
.CommandBars("Worksheet Menu Bar").Controls("View").Controls("Formula Bar").Enabled = True
.CommandBars("Worksheet Menu Bar").Controls("View").Controls("Toolbars").Enabled = True
.CommandBars("Toolbar List").Enabled = True
.CommandBars("Worksheet Menu Bar").Controls("Tools").Controls("Customize...").Enabled = True
Application.CommandBars("File").Enabled = True
Application.CommandBars("Edit").Enabled = True
Application.CommandBars("View").Enabled = True
Application.CommandBars("Worksheet Menu Bar").Controls("Insert").Enabled = True
Application.CommandBars("Format").Enabled = True
Application.CommandBars("Tools").Enabled = True
Application.CommandBars("Data").Enabled = True
Application.CommandBars("Window").Enabled = True
Application.CommandBars("Help").Enabled = True
For Each a In Application.CommandBars
Application.CommandBars(a.Name).Enabled = True

Next
End With
End Sub
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
I don't need to try, I can read. If you are wanting to know if it works, or how, I suggest two things: 1) run the code yourself, stepping through it with F8, and 2) read a book on Excel VBA.

Was that the only question? "Is it workable?" ??
 
Upvote 0

Forum statistics

Threads
1,203,691
Messages
6,056,756
Members
444,889
Latest member
ibbara

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top