Solved

Open Excel read only or modify mode

Posted on 2016-10-10
3
40 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 6

Expert Comment

by:DPatel
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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

810 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