richard.ca
Board Regular
- Joined
- Nov 7, 2007
- Messages
- 100
I am just trying out the protect sheet with UserInterFaceOnly option (running an ancient Excel 2000) to avoid having
to unprotect/protect every time my code wants to make a change on the sheet. Eg:
In general it seems to work fine but then I found something peculiar with sorting: the sheet somehow becomes
unprotected after I run the following sort code:
The sort function works normally and does not seem to produce any other unexpected side effects apart from leaving
the sheet unprotected. I assume this has to be a bug of some sort. Not really a huge issue since I can simply
reprotect the sheet after calling sort; the point is it shouldn't really be necessary.
Anyone else encountered this problem? I would imagine it has been fixed in later versions of Excel...
to unprotect/protect every time my code wants to make a change on the sheet. Eg:
Code:
Sheets("sheet name").Protect "password", UserInterFaceOnly:=True
In general it seems to work fine but then I found something peculiar with sorting: the sheet somehow becomes
unprotected after I run the following sort code:
Code:
Range(my_range).CurrentRegion.Sort Key1:=Range(my_range), Order1:=xlAscending, header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
The sort function works normally and does not seem to produce any other unexpected side effects apart from leaving
the sheet unprotected. I assume this has to be a bug of some sort. Not really a huge issue since I can simply
reprotect the sheet after calling sort; the point is it shouldn't really be necessary.
Anyone else encountered this problem? I would imagine it has been fixed in later versions of Excel...