Solved

Make Excel File for End user in Read Only

Posted on 2011-02-19
3
808 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:teylyn
teylyn 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
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.

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now