I hope you are well and staying safe.
I have been working on what should be a relatively straightforward piece of code but I can't get it right and I don't have much hair left to pull out!
Can someone take a look at the below please?
What I am trying to do is load a workbook, check today's date versus a defined expiry date (exdate), if the expiry date is in the future then continue to open the workbook. If it is in the past (i.e. workbook expired) then I would like two options, one is an admin password ("test" in the below text) to let me in, the other would be a password to extend the life ("extend" in the below text). My intention would be to permit three extensions (stored in a named range/cell called ExtensionCount) and each time the "extend" password is used the macro will +1 onto the cell value. If you go over 3 extensions then the macro would inform you via a msgbox and exit, if you are 3 extensions or below it lets you in.
I apologise in advance for my bad code, I'm chopping up someone else's solution to a simpler problem. I feel like it's pretty close but when I enter the extend password it is closing the workbook, I think I'm getting confused with the IFs and when to End If.
Thanks for any advice you could offer.