No, it doesn't prompt for the password. If you want a password, simply pass it as the only argument to protect. In the code you supplied, you protected the worksheet with a password of 'test123'.
Update: I may have misunderstood your question but runrig answered nicely.
In reply to Re^3: password protet excel sheet
by Mr. Muskrat
in thread password protet excel sheet
by mangrove
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |