I need to display Excel Sheet in a Browser and I want to disable
the Right Click and Menu of Excel(File, Edit).
So in the method Workbook_Open i coded following
Code
Private Sub Workbook_Open()
Application.CommandBars("Worksheet Menu Bar").Enabled = False
Application.CommandBars("Cell").Enabled = False
Application.CommandBars("Sheet").Enabled = False
Application.CommandBars("Ply").Enabled = False
Application.CommandBars("Row").Enabled = False
Application.CommandBars("Column").Enabled = False
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.CommandBars("Worksheet Menu Bar").Enabled = True
Application.CommandBars("Cell").Enabled = True
Application.CommandBars("Sheet").Enabled = True
Application.CommandBars("Ply").Enabled = True
Application.CommandBars("Row").Enabled = True
Application.CommandBars("Column").Enabled = True
End Sub
Display More
It works fine, but if I open Excel application before viewing this HTML page(which contains XLS) and then the option are also disabled in Stand alone Excel application. I want to disable option when for this Sheet which is opened.
Could somebody help me in solving the above problem.