Disable the Ability to access any and all menu's and tool bars

srivet

New Member
Joined
Jan 5, 2014
Messages
2
Hello, I'm looking for a code or macro to Disable the Ability to access any and all menu's and tool bars in protected mode. I don't want the user to be able to hit esc to view or gain access to the toolbars or menus when they load the workbook, the workbook needs to automatically open to full screen view, when in full screen mode, have no ability to leave full screen mode. save can be there only function other then what's not locked in each sheet. I haven't been able to figure this one out. I'm new to Macros and need serious help as the user always seem to find a way to destroy the workbooks..
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Don't know how much of this you want to use, but it basically hides everything. I suggest you try this on a blank workbook before trying it on one that contains data. Note that the restore macro Clears the cells, which means that if you want to save any data, you need to comment that line out or delete it.
Code:
Sub clrScrn() 
    ActiveWindow.ScrollRow = 1
    ActiveWindow.ScrollColumn = 1
    With Application
        .DisplayFullScreen = True
        .DisplayFormulaBar = False
        .DisplayStatusBar = False
    End With
    With ActiveWindow
        .DisplayHorizontalScrollBar = False     'Make space and clear screen
        .DisplayVerticalScrollBar = False
        .DisplayWorkbookTabs = False
        .DisplayHeadings = False
        .DisplayGridlines = False
    End With
End Sub
Then this would restore it.
Code:
Sub RestoreToNorm()
    With ActiveSheet        
        .Cells.Clear
        .Columns.UseStandardWidth = True
        .Rows.UseStandardHeight = True
    End With
    With Application
        .DisplayFullScreen = False
        .DisplayFormulaBar = True
        .DisplayStatusBar = True
    End With
    With ActiveWindow       'This with statement sets everything to normal
        .DisplayHorizontalScrollBar = True
        .DisplayVerticalScrollBar = True
        .DisplayWorkbookTabs = True
        .DisplayHeadings = True
        .DisplayGridlines = True
    End With
    ThisWorkbook.Save
End Sub

It still might not be what you are looking for, because a knowledgable person could easily get around the lack of menus using function keys, etc.
 
Upvote 0
Do I add this to the "ThisWorkbook" VBA or "Module1"? I have added to both with failure. the workbook still opens with the tools menu showing.
 
Upvote 0
Not sure where your file resides. There are no menus visible in the Excel application after the macro runs to hide them. If you are using a web address for your files, then this code would not necessarily hide all menus.
 
Upvote 0

Forum statistics

Threads
1,214,839
Messages
6,121,892
Members
449,058
Latest member
Guy Boot

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