0
votes

I'm working on an excel file, and i did a workbook_open event that show a input box to make the user enter a specific password (because each password open certain part of the file) but i have a problem that if the user doesn't enabled macro, he can see all the information in the file, so I'm looking for a way to prevent the user from read or use the file if he doesn't enabled macro.

1
The only way you can really handle this is to hide the worksheets before close, and have your code unhide them if the password is entered correctly. Eg. dummies.com/software/microsoft-office/excel/…Tim Williams

1 Answers

0
votes

it may be possible to protect Excel spreadsheets and this VBA code will remove the protection:

enter code here Workbooks("salary ").Worksheets("data").UnProtect Password:="xyz"

I'm afraid a password is not good enough protection for your file, See this link: Decoding a password that protects an Excel file(The site is not in English)