Prevent opening file if macros not enabled

318 Views Asked by At

I did a workbook_open event that shows an input box to enter a specific password (each password opens a certain part of the file).

However, I have a problem that if the user doesn't enable the macro, he can see all the information in the file.

I'm looking for a way to prevent the user from reading or using the file if he doesn't enable the macro.

1

There are 1 best solutions below

0
On

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

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

A password is not good enough protection for your file:
Decoding a password that protects an Excel file (the site is not in English).