Hi guys,
From all the help I got from this forum I created a Single Sheet Excel File and used the following code.
Following are the problems which I need to resolve.
1. Whenever I start excel all the commands mentioned for this file are disabled for all new files by default. Thus I cant create any new file ....
I want that menu actions from this particular file shud be disabled but available to other files.
2. Disabling Insert menu commands does not work????
3. Will this code work on Excel 97 ? I am using Excel XP but my client has 97...
Thanks
Tanmay.
Heres the code...
=====================================================
Private Sub ThisWorkbook_Activate()
' Turn off the menu
Application.CommandBars("File").Controls(1).Enabled = False
Application.CommandBars("File").Controls(2).Enabled = False
'Application.CommandBars("File").Controls(4).Enabled = True
Application.CommandBars("File").Controls(5).Enabled = False
Application.CommandBars("File").Controls(6).Enabled = False
Application.CommandBars("Insert").Controls(1).Enabled = False
Application.CommandBars("Insert").Controls(2).Enabled = False
Application.CommandBars("Insert").Controls(3).Enabled = False
Application.CommandBars("Edit").Controls(3).Enabled = False
Application.CommandBars("Edit").Controls(3).Enabled = False
Application.CommandBars("Edit").Controls(4).Enabled = False
Application.CommandBars("Edit").Controls(5).Enabled = False
Application.CommandBars("Edit").Controls(6).Enabled = False
' Turn off the toolbar:
Application.CommandBars("Standard").Controls(1).Enabled = False
Application.CommandBars("Standard").Controls(2).Enabled = False
'Application.CommandBars("Standard").Controls(3).Enabled = True
Application.CommandBars("Standard").Controls(9).Enabled = False
Application.CommandBars("Standard").Controls(10).Enabled = False
Application.CommandBars("Standard").Controls(11).Enabled = False
' turn off shortcutkeys:
Application.OnKey "^c", ""
Application.OnKey "^v", ""
Application.OnKey "^x", ""
End Sub
Sub FullNameInRightFooter()
ActiveSheet.PageSetup.RightFooter = ActiveWorkbook.FullName
End Sub
Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
Cancel = True
MsgBox "Right Click Disabled."
End Sub
====================================================
From all the help I got from this forum I created a Single Sheet Excel File and used the following code.
Following are the problems which I need to resolve.
1. Whenever I start excel all the commands mentioned for this file are disabled for all new files by default. Thus I cant create any new file ....
I want that menu actions from this particular file shud be disabled but available to other files.
2. Disabling Insert menu commands does not work????
3. Will this code work on Excel 97 ? I am using Excel XP but my client has 97...
Thanks
Tanmay.
Heres the code...
=====================================================
Private Sub ThisWorkbook_Activate()
' Turn off the menu
Application.CommandBars("File").Controls(1).Enabled = False
Application.CommandBars("File").Controls(2).Enabled = False
'Application.CommandBars("File").Controls(4).Enabled = True
Application.CommandBars("File").Controls(5).Enabled = False
Application.CommandBars("File").Controls(6).Enabled = False
Application.CommandBars("Insert").Controls(1).Enabled = False
Application.CommandBars("Insert").Controls(2).Enabled = False
Application.CommandBars("Insert").Controls(3).Enabled = False
Application.CommandBars("Edit").Controls(3).Enabled = False
Application.CommandBars("Edit").Controls(3).Enabled = False
Application.CommandBars("Edit").Controls(4).Enabled = False
Application.CommandBars("Edit").Controls(5).Enabled = False
Application.CommandBars("Edit").Controls(6).Enabled = False
' Turn off the toolbar:
Application.CommandBars("Standard").Controls(1).Enabled = False
Application.CommandBars("Standard").Controls(2).Enabled = False
'Application.CommandBars("Standard").Controls(3).Enabled = True
Application.CommandBars("Standard").Controls(9).Enabled = False
Application.CommandBars("Standard").Controls(10).Enabled = False
Application.CommandBars("Standard").Controls(11).Enabled = False
' turn off shortcutkeys:
Application.OnKey "^c", ""
Application.OnKey "^v", ""
Application.OnKey "^x", ""
End Sub
Sub FullNameInRightFooter()
ActiveSheet.PageSetup.RightFooter = ActiveWorkbook.FullName
End Sub
Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
Cancel = True
MsgBox "Right Click Disabled."
End Sub
====================================================