Solved

Open Excel read only or modify mode

Posted on 2016-10-10
3
45 Views
Last Modified: 2016-10-30
How can I Open Excel with only one popup and if user enter password "passwd1" I want to open the excel with read only mode and if user enter password "passwd2" then I want to open the excel with modify mode.
0
Comment
Question by:Bharat Guru
  • 2
3 Comments
 
LVL 7

Expert Comment

by:D Patel
ID: 41837894
Your query is going to be answered at here :

https://support.office.com/en-us/article/Protect-an-Excel-file-7359d4ae-7213-4ac2-b058-f75e9311b599

Thanks and Regards,
D Patel
0
 
LVL 7

Accepted Solution

by:
Andy earned 500 total points (awarded by participants)
ID: 41837902
The functionality you ask for isn't built into excel by default, the options you have are below (assuming the sheets are on the same workbook):
You could use the 'Allow Users to Edit Ranges' option in Excel.

Or you could use VBA code such as:

Private Sub Workbook_Open()
Dim sh As Worksheet
For Each sh In Sheets
   sh.Visible = xlSheetVisible
Next sh
Select Case Environ("UserName")
Case "User1", "User2", "User3"
   Sheet2.Visible = xlSheetVeryHidden
   Sheet3.Visible = xlSheetVeryHidden
Case "User4", "User5"
   Sheet2.Visible = xlSheetVeryHidden
   Sheet1.Visible = xlSheetVeryHidden
'etc
Case Else:
End Select
End Sub

It goes in the This WorkBook module and runs when the workbook is opened.
User1 etc. aren't  users actual logon names. You'd need to replace them with the users actual names.

Thanks,
Andy
0
 
LVL 7

Expert Comment

by:Andy
ID: 41865733
Question was answered directly as required by the OP
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

856 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