Hi,
I have a task to create Excel sheet for team of people with questionable PC skills.
For that reason I have created several foolproof safety nets using VBA, but they fail on one thing now.
In order to make sure they work, I need make sure that people who use that file have macros enabled.
To make sure they do, I have set the input fields as locked by default and added
This way you either have all the safety macros running or you can't use the file at all.
It does some other little things, but this one is important here.
Now the problem is that I need to make sure, that the column B is locked again by default every time someone opens the workbook, no matter how the person before closed it, saved or unsaved.
I tried playing around with "BeforeSave" "AfterSave" and "BeforeClose" and while it does work for some other things like hiding and showing warning message, it never seems to work on locking cells. I think the main issue is that when someone closes the file without saving, the B column simply remains unlocked.
Any idea?
Or alternatively and other idea that might do the same thing?
I have a task to create Excel sheet for team of people with questionable PC skills.
For that reason I have created several foolproof safety nets using VBA, but they fail on one thing now.
In order to make sure they work, I need make sure that people who use that file have macros enabled.
To make sure they do, I have set the input fields as locked by default and added
Code:
Private Sub workbook_open()
Range("B:B").Locked = false
End sub
This way you either have all the safety macros running or you can't use the file at all.
It does some other little things, but this one is important here.
Now the problem is that I need to make sure, that the column B is locked again by default every time someone opens the workbook, no matter how the person before closed it, saved or unsaved.
I tried playing around with "BeforeSave" "AfterSave" and "BeforeClose" and while it does work for some other things like hiding and showing warning message, it never seems to work on locking cells. I think the main issue is that when someone closes the file without saving, the B column simply remains unlocked.
Any idea?
Or alternatively and other idea that might do the same thing?