Solved

Open Excel read only or modify mode

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Formula 6 45
splitting text of cell to columns 14 22
How can I set the SlideShow Settings via VBA in PowerPoint? 23 49
MS Excel IF AND OR statement 3 21
No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

943 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

4 Experts available now in Live!

Get 1:1 Help Now