Solved

Make Excel File for End user in Read Only

Posted on 2011-02-19
3
842 Views
Last Modified: 2012-05-11
How to make an Excel File to be opened to the end user in only Read Only mode, the end user should not be able to save the data that have been queried in the same spreadsheet.

EX: I have an VBA in the excel , if the end user has extracted data using my VBA and displayed in the spreadsheet, but he should not be able to save the spreadsheet altering from original.


0
Comment
Question by:srikanthv2322
3 Comments
 
LVL 2

Accepted Solution

by:
mscanlon06851 earned 167 total points
ID: 34933648
Why don't you just set the read attribute of the user's Excel file to read-only?  

Launch Windows Explorer
Navigate to the folder containing the Excel workbook
Right-click on the workbook name
Click Properties
Click on the Read-only box
Click OK

0
 
LVL 22

Assisted Solution

by:rspahitz
rspahitz earned 166 total points
ID: 34934250
Yup...that's what'd I'd do too.
Another way is to save it as a template.  If the user tries to save, it will typically save as a different name so the original is still there.  (Not as fool-proof as the read-only windows flag, though.)
0
 
LVL 50

Assisted Solution

by:Ingeborg Hawighorst
Ingeborg Hawighorst earned 167 total points
ID: 34935781
Hello,

you can protect the worksheets against changes as described above. But the user will still be able to use the Save As command to save a copy of the workbook.

If you would like to disable that, you can put a macro in the ThisWorkbook module

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    If SaveAsUI Then Cancel = True
End Sub

Open in new window


See attached file. You will need to password-protect the VBA code, too.

I've not protected the VBA, so you should be able to change it. The attached file is for Excel 2007 and later, since you did not specify an Excel version.

Note that it is pretty easy to disable the VBA password in Excel 2003.

Password protection has never been good in Excel. It's a bit better in versions later than 2003, but you never know what hacks will be cooked up and posted on the internet soon.

cheers, teylyn
test.xlsm
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question