Make spreadsheet with only rows and columns, everything else hidden and locked and make only Save As (Ctrl+s) available

CasperA

Board Regular
Joined
Jun 8, 2015
Messages
55
Is it possible to create a spreadsheet with only the rows and columns visible, all else hidden and locked, and to make only the Save As option available?

Thank you in advance,

CA
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
No. And from what I read breaking Excel "locks" isn't hard for the resourceful-determined.
Sounds more like you want a PDF, XPS or HTML copy of the worksheet.
 
Upvote 0
The last part of your request....

Place the below code into the "ThisWorkbook" module of your workbook.

Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If SaveAsUI Then MsgBox "You are not allowed to use SaveAs, only the Save Command."
Cancel = SaveAsUI
End Sub

As regards the first part of your request...

You could Protect the Sheet..
 
Upvote 0
No. And from what I read breaking Excel "locks" isn't hard for the resourceful-determined.
Sounds more like you want a PDF, XPS or HTML copy of the worksheet.

Thanks for the input. I would like a user of the spreadsheet to be able to enter data in the cells, but not change anything else to the spreadsheet, except save it. The suggestion below to protect the spreadsheet might be useful.
 
Upvote 0
The last part of your request....

Place the below code into the "ThisWorkbook" module of your workbook.

Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If SaveAsUI Then MsgBox "You are not allowed to use SaveAs, only the Save Command."
Cancel = SaveAsUI
End Sub

As regards the first part of your request...

You could Protect the Sheet..

Thank you Jim for the suggestion to protect the worksheet. In your code I would like to swap Save and Save As (the user should be able to Save As, not to Save). I assume I can replace Save by SaveAs and SaveAs by Save in the code.
 
Upvote 0
Replace with:

Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If Not SaveAsUI Then MsgBox "You are not allowed to use Save, only the SaveAs Command."
Cancel = Not SaveAsUI
End Sub
 
Upvote 0
Replace with:

Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If Not SaveAsUI Then MsgBox "You are not allowed to use Save, only the SaveAs Command."
Cancel = Not SaveAsUI
End Sub

Thank you very much!

CA
 
Upvote 0

Forum statistics

Threads
1,203,024
Messages
6,053,100
Members
444,639
Latest member
xRockox

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