The reason why you got a "No selection available ” error could be becausethe selection mode is set on something else than Single selection, which means you have to select an object first before you can do anything with it besides viewing.
Or you just have Select first on