Object Not Locked

I'm trying to create a new index at runtime. I have set for exclusive
use of the table and tried locking it for read and write access but keep
receiving a 'object not locke error'

please help !!!!