password protected excel file

methode2404

New Member
Joined
Sep 3, 2018
Messages
30
Hi,

It is possible to write a macro, for closing password protected excel file, on wrong password entry and no-entry for 10 seconds.

regards
Metin
 
just for info:

any smart user can break the sheet/vba project password very fast then he can see password contained in vba code
you can try obfuscate vba code and it will be quite a difficult time to recognize the password in the code
maybe any vba master will do that for you

have a nice day

If they have the knowledge to get around the VBA protection then they have the knowledge to bypass any other password the OP sets via a macro just as easily.
I need the code for : Closing workbook on wrong password entry and closing workbook if there no entry in 10 seconds
methode2404, if they haven't entered the password correctly when the dialog comes up to unprotect the workbook (via the workbook protection) then the workbook has never been open. They only have the option to cancel the opening at that stage.
 
Last edited:
Upvote 0

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
If they have the knowledge to get around the VBA protection then they have the knowledge to bypass any other password the OP sets via a macro just as easily.
sure, enough to stop run macro/vba on open file the you have access to everything but obfuscated vba code is very hard to read and recover the code (password)
protection in Excel is illusory
 
Upvote 0
obfuscated vba code is very hard to read and recover the code

Not that hard ;) (obviously you could compile the code to to a DLL or EXE using something like C++ which makes it more difficult) but the objective of the OP is to set a password via a macro which if incorrect closes the workbook which is even easier to bypass without touching the VB Editor.

At the end of the day VBA is just not secure and so it just depends how much knowledge (determination) the users have.
 
Upvote 0

Forum statistics

Threads
1,213,561
Messages
6,114,317
Members
448,564
Latest member
ED38

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top