ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Presetting options when opening Excel (https://www.excelbanter.com/excel-programming/388300-presetting-options-when-opening-excel.html)

Josh C

Presetting options when opening Excel
 
I want to open Excel and run a program that has some sensitive material. I do
not want the user to do anything without using buttons that I have developed.
I would like to make sure that all the toolbars are removed and most of the
menu items bars are not useable. I have to do this because each computer
opens Excel the same way it was shut down last. I will also had to restore
the menu options, so the next time the user is in a different Excel file they
can use them.

Mike

Presetting options when opening Excel
 
Private Sub Workbook_Open()
Worksheets(MTSheet).Select
Range("A1").Select
ActiveWindow.ScrollRow = 1
ActiveWindow.ScrollColumn = 1
Application.EnableCancelKey = xlDisabled

Application.CommandBars("Formatting").Visible = False
Application.CommandBars("Borders").Visible = False
Application.CommandBars("Chart").Visible = False
Application.CommandBars("Control Toolbox").Visible = False
Application.CommandBars("Drawing").Visible = False
Application.CommandBars("External Data").Visible = False
Application.CommandBars("Forms").Visible = False
Application.CommandBars("Formula Auditing").Visible = False
Application.CommandBars("Picture").Visible = False
Application.CommandBars("PivotTable").Visible = False
Application.CommandBars("Protection").Visible = False
Application.CommandBars("Reviewing").Visible = False
Application.CommandBars("Text To Speech").Visible = False
Application.CommandBars("Visual Basic").Visible = False
Application.CommandBars("Watch Window").Visible = False
Application.CommandBars("Web").Visible = False
Application.CommandBars("WordArt").Visible = False
Application.CommandBars("Standard").Visible = False
Application.CommandBars("Stop Recording").Visible = False

End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)


Application.CommandBars("Standard").Visible = True
End Sub


"Josh C" wrote:

I want to open Excel and run a program that has some sensitive material. I do
not want the user to do anything without using buttons that I have developed.
I would like to make sure that all the toolbars are removed and most of the
menu items bars are not useable. I have to do this because each computer
opens Excel the same way it was shut down last. I will also had to restore
the menu options, so the next time the user is in a different Excel file they
can use them.


Josh C

Presetting options when opening Excel
 
this will execute before the file is opened

"Mike" wrote:

Private Sub Workbook_Open()
Worksheets(MTSheet).Select
Range("A1").Select
ActiveWindow.ScrollRow = 1
ActiveWindow.ScrollColumn = 1
Application.EnableCancelKey = xlDisabled

Application.CommandBars("Formatting").Visible = False
Application.CommandBars("Borders").Visible = False
Application.CommandBars("Chart").Visible = False
Application.CommandBars("Control Toolbox").Visible = False
Application.CommandBars("Drawing").Visible = False
Application.CommandBars("External Data").Visible = False
Application.CommandBars("Forms").Visible = False
Application.CommandBars("Formula Auditing").Visible = False
Application.CommandBars("Picture").Visible = False
Application.CommandBars("PivotTable").Visible = False
Application.CommandBars("Protection").Visible = False
Application.CommandBars("Reviewing").Visible = False
Application.CommandBars("Text To Speech").Visible = False
Application.CommandBars("Visual Basic").Visible = False
Application.CommandBars("Watch Window").Visible = False
Application.CommandBars("Web").Visible = False
Application.CommandBars("WordArt").Visible = False
Application.CommandBars("Standard").Visible = False
Application.CommandBars("Stop Recording").Visible = False

End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)


Application.CommandBars("Standard").Visible = True
End Sub


"Josh C" wrote:

I want to open Excel and run a program that has some sensitive material. I do
not want the user to do anything without using buttons that I have developed.
I would like to make sure that all the toolbars are removed and most of the
menu items bars are not useable. I have to do this because each computer
opens Excel the same way it was shut down last. I will also had to restore
the menu options, so the next time the user is in a different Excel file they
can use them.


Josh C

Presetting options when opening Excel
 
that works good. what happens when they have a custome toolbar with a name we
do not know. and is there a way to clear the menu bars

"Mike" wrote:

Private Sub Workbook_Open()
Worksheets(MTSheet).Select
Range("A1").Select
ActiveWindow.ScrollRow = 1
ActiveWindow.ScrollColumn = 1
Application.EnableCancelKey = xlDisabled

Application.CommandBars("Formatting").Visible = False
Application.CommandBars("Borders").Visible = False
Application.CommandBars("Chart").Visible = False
Application.CommandBars("Control Toolbox").Visible = False
Application.CommandBars("Drawing").Visible = False
Application.CommandBars("External Data").Visible = False
Application.CommandBars("Forms").Visible = False
Application.CommandBars("Formula Auditing").Visible = False
Application.CommandBars("Picture").Visible = False
Application.CommandBars("PivotTable").Visible = False
Application.CommandBars("Protection").Visible = False
Application.CommandBars("Reviewing").Visible = False
Application.CommandBars("Text To Speech").Visible = False
Application.CommandBars("Visual Basic").Visible = False
Application.CommandBars("Watch Window").Visible = False
Application.CommandBars("Web").Visible = False
Application.CommandBars("WordArt").Visible = False
Application.CommandBars("Standard").Visible = False
Application.CommandBars("Stop Recording").Visible = False

End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)


Application.CommandBars("Standard").Visible = True
End Sub


"Josh C" wrote:

I want to open Excel and run a program that has some sensitive material. I do
not want the user to do anything without using buttons that I have developed.
I would like to make sure that all the toolbars are removed and most of the
menu items bars are not useable. I have to do this because each computer
opens Excel the same way it was shut down last. I will also had to restore
the menu options, so the next time the user is in a different Excel file they
can use them.



All times are GMT +1. The time now is 03:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com