Link to home
Start Free TrialLog in
Avatar of thomas-sherrouse
thomas-sherrouseFlag for United States of America

asked on

Set an Open Password for an Excel File using VBA

I want to set a Password to Open an Excel File using VBA.

I do not want to use the built Password option in Excel (Save As -> Tools -> Password to Open).

I want to use a Macro that prompts the user for a Password before they can do anything within the file.

Is this possible?
SOLUTION
Avatar of Saurabh Singh Teotia
Saurabh Singh Teotia
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of thomas-sherrouse

ASKER

I wanted to see if I could reference the file with out the inbuilt password. Anyone who would be utilizing the referenced sheet wouldn't be sophisticated enough to find out any other information.

I thought there was a way to locked down the sheet and force someone to enable macros or a way to block access to through VBA, but if there isn't I can figure something else out.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If my post above isn't want you want then perhaps you just want to protect a sheet. To do so go to the 'Review' tab and select 'Protect Sheet' from the 'Changes' group and enter and confirm your password when prompted.
@thomas-sherrouse: I just noticed that you gave me a "B" grade. Why? Please see this EE article on grading particularly where it says the following. The bolding is mine.
B is the grade given for acceptable solutions, or a link to an acceptable solution. A B grade means the solution given lacked some information or required you to do a good amount of extra work to resolve the problem. When closing the question, the asker should explain why a B grade was awarded
.

Please consider Requesting Attention so that a moderator can help you change the grade.