ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   prevent users from adding sheets / charts (https://www.excelbanter.com/excel-programming/421008-prevent-users-adding-sheets-charts.html)

Ian

prevent users from adding sheets / charts
 
All,

Searched for a while, but haven't found an answer to this one yet. I have a
workbook that I do not want the users to add worksheets or charts to. In
particular by a stray keystroke of F11 (like when I forget to hold alt and
hit it myself :-/ )

Is there a way to disable adding sheets / charts?

TIA,
Ian

Spreadsheet Solutions[_3_]

prevent users from adding sheets / charts
 
Ian;

Did you Google on "Disable F1 Key".
I know there is some stuff to find about that topic and your question might
probably be answered the same way.

Actually, here it is.

a.. Unhide your personal.xls file
a.. Tools-Macros-Visual Basic Editor
a.. Choose the "ThisWorkbook" file icon in the upper left hand box
a.. Add this VB code:

Private Sub Workbook_Open()
Application.OnKey "{F1}", ""
End Sub
a.. Save the file, and close.

Result: No more accidental MS help windows!

I did not test it, but I assume that it might help with F11 as well.

--
Regards;
Mark Rosenkrantz
--
Spreadsheet Solutions
Uithoorn
Netherlands (the country were they live some 18 feet beyond sea level)

E:
W:
www.spreadsheetsolutions.nl
--
"Ian" wrote in message
...
All,

Searched for a while, but haven't found an answer to this one yet. I have
a
workbook that I do not want the users to add worksheets or charts to. In
particular by a stray keystroke of F11 (like when I forget to hold alt and
hit it myself :-/ )

Is there a way to disable adding sheets / charts?

TIA,
Ian



signon77

prevent users from adding sheets / charts
 
On Dec 9, 6:44*am, "Spreadsheet Solutions"
wrote:
Ian;

Did you Google on "Disable F1 Key".
I know there is some stuff to find about that topic and your question might
probably be answered the same way.

Actually, here it is.

a.. Unhide your personal.xls file
a.. Tools-Macros-Visual Basic Editor
a.. Choose the "ThisWorkbook" file icon in the upper left hand box
a.. Add this VB code:

* Private Sub Workbook_Open()
* Application.OnKey "{F1}", ""
* End Sub
a.. Save the file, and close.

Result: No more accidental MS help windows!

I did not test it, but I assume that it might help with F11 as well.

--
Regards;
Mark Rosenkrantz
--
Spreadsheet Solutions
Uithoorn
Netherlands (the country were they live some 18 feet beyond sea level)

E:
W:www.spreadsheetsolutions.nl
*--"Ian" wrote in message

...



All,


Searched for a while, but haven't found an answer to this one yet. *I have
a
workbook that I do not want the users to add worksheets or charts to. *In
particular by a stray keystroke of F11 (like when I forget to hold alt and
hit it myself :-/ *)


Is there a way to disable adding sheets / charts?


TIA,
Ian- Hide quoted text -


- Show quoted text -


Wouldn't the simplest solution be to make the spreadsheet read-only so
no-one can make permanent changes?

Rob

Jim Cone[_2_]

prevent users from adding sheets / charts
 

Protecting the workbook (structure) prevents the addition of sheets.
--
Jim Cone
Portland, Oregon USA



"Ian"
wrote in message
All,
Searched for a while, but haven't found an answer to this one yet. I have a
workbook that I do not want the users to add worksheets or charts to. In
particular by a stray keystroke of F11 (like when I forget to hold alt and
hit it myself :-/ )
Is there a way to disable adding sheets / charts?
TIA,
Ian

Ian

prevent users from adding sheets / charts
 

Hi guys,

Thanks for the replies. Unfortunately, the book I'm making is a score sheet
that the users have to enter data into, however I do not want them to be able
to add worksheets via InsertWorksheet, nor do I want them to add a chart
sheet via InsertChart or simply the F11 key.

I cannot make the workbook read only as that defeats the purpose of the
score sheet.

Mark's solution of the onkey command takes care of part of the problem.
Anyone know how to prevent the rest?

Thanks,
Ian

"Jim Cone" wrote:

Protecting the workbook (structure) prevents the addition of sheets.
--
Jim Cone
Portland, Oregon USA





Jim Cone[_2_]

prevent users from adding sheets / charts
 
And what is the problem you have when you protect the workbook | structure?
--
Jim Cone
Portland, Oregon USA




"Ian"
wrote in message
Hi guys,
Thanks for the replies. Unfortunately, the book I'm making is a score sheet
that the users have to enter data into, however I do not want them to be able
to add worksheets via InsertWorksheet, nor do I want them to add a chart
sheet via InsertChart or simply the F11 key.
I cannot make the workbook read only as that defeats the purpose of the
score sheet.
Mark's solution of the onkey command takes care of part of the problem.
Anyone know how to prevent the rest?
Thanks,
Ian



"Jim Cone" wrote:
Protecting the workbook (structure) prevents the addition of sheets.
--
Jim Cone
Portland, Oregon USA



Ian

prevent users from adding sheets / charts
 
Nothing... just couldn't get the code to work... everything good now. Thanks
for pointing me in the right direction.

For those searching, code is:

Workbooks(Workbook_Name).Protect Password:=PW, Structu=True

and to unprotect
Workbooks(Workbook_Name).Unprotect Password:=PW


-Ian

"Jim Cone" wrote:

And what is the problem you have when you protect the workbook | structure?
--
Jim Cone
Portland, Oregon USA




"Ian"
wrote in message
Hi guys,
Thanks for the replies. Unfortunately, the book I'm making is a score sheet
that the users have to enter data into, however I do not want them to be able
to add worksheets via InsertWorksheet, nor do I want them to add a chart
sheet via InsertChart or simply the F11 key.
I cannot make the workbook read only as that defeats the purpose of the
score sheet.
Mark's solution of the onkey command takes care of part of the problem.
Anyone know how to prevent the rest?
Thanks,
Ian



"Jim Cone" wrote:
Protecting the workbook (structure) prevents the addition of sheets.
--
Jim Cone
Portland, Oregon USA





All times are GMT +1. The time now is 12:35 PM.

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